mercurial/subrepo.py
changeset 21888 dfb8f757750c
parent 21887 9aaffb22d7d7
child 21889 ee7e8dcffc92
--- a/mercurial/subrepo.py	Fri Jun 20 00:21:19 2014 +0900
+++ b/mercurial/subrepo.py	Fri Jun 20 00:21:19 2014 +0900
@@ -576,8 +576,10 @@
         if not os.path.exists(cachefile):
             return ''
         fd = open(cachefile, 'r')
-        pullstate = fd.readlines()
-        fd.close()
+        try:
+            pullstate = fd.readlines()
+        finally:
+            fd.close()
         return pullstate
 
     def _cachestorehash(self, remotepath):