Submitter | Katsunori FUJIWARA |
---|---|
Date | June 19, 2014, 3:43 p.m. |
Message ID | <a20591a932b7a3420eb8.1403192598@juju> |
Download | mbox | patch |
Permalink | /patch/5016/ |
State | Accepted |
Commit | 9aaffb22d7d7e59d5079368536011a17bc2804de |
Headers | show |
Comments
Patch
diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py --- a/mercurial/subrepo.py +++ b/mercurial/subrepo.py @@ -35,8 +35,10 @@ def _calcfilehash(filename): data = '' if os.path.exists(filename): fd = open(filename, 'rb') - data = fd.read() - fd.close() + try: + data = fd.read() + finally: + fd.close() return util.sha1(data).hexdigest() class SubrepoAbort(error.Abort):