hgext/largefiles/overrides.py
branchstable
changeset 15576 e387e760b207
parent 15383 155d0f8fb7e5
child 15598 a77ce45584ef
--- a/hgext/largefiles/overrides.py	Fri Nov 25 02:09:45 2011 +0100
+++ b/hgext/largefiles/overrides.py	Fri Nov 25 02:09:48 2011 +0100
@@ -619,11 +619,13 @@
             f = lfutil.splitstandin(f)
 
             def getdatafn():
+                fd = None
                 try:
                     fd = open(path, 'rb')
                     return fd.read()
                 finally:
-                    fd.close()
+                    if fd:
+                        fd.close()
 
             getdata = getdatafn
         write(f, 'x' in ff and 0755 or 0644, 'l' in ff, getdata)