diff hgext/gpg.py @ 13400:14f3795a5ed7

explicitly close files Add missing calls to close() to many places where files are opened. Relying on reference counting to catch them soon-ish is not portable and fails in environments with a proper GC, such as PyPy.
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
date Fri, 24 Dec 2010 15:23:01 +0100
parents 0d4fb319974b
children 135e244776f0
line wrap: on
line diff
--- a/hgext/gpg.py	Fri Feb 11 22:24:10 2011 +0800
+++ b/hgext/gpg.py	Fri Dec 24 15:23:01 2010 +0100
@@ -244,7 +244,9 @@
                            "(please commit .hgsigs manually "
                            "or use --force)"))
 
-    repo.wfile(".hgsigs", "ab").write(sigmessage)
+    sigsfile = repo.wfile(".hgsigs", "ab")
+    sigsfile.write(sigmessage)
+    sigsfile.close()
 
     if '.hgsigs' not in repo.dirstate:
         repo[None].add([".hgsigs"])