misc: adding missing file close() calls
Spotted by Victor Stinner <victor.stinner@haypocalc.com>
--- a/mercurial/ignore.py Tue Nov 01 15:37:00 2011 -0500
+++ b/mercurial/ignore.py Thu Nov 03 11:24:55 2011 -0500
@@ -78,6 +78,7 @@
pats[f] = []
fp = open(f)
pats[f], warnings = ignorepats(fp)
+ fp.close()
for warning in warnings:
warn("%s: %s\n" % (f, warning))
except IOError, inst:
--- a/mercurial/revlog.py Tue Nov 01 15:37:00 2011 -0500
+++ b/mercurial/revlog.py Thu Nov 03 11:24:55 2011 -0500
@@ -800,6 +800,7 @@
readahead = max(65536, length)
df.seek(offset)
d = df.read(readahead)
+ df.close()
self._addchunk(offset, d)
if readahead > length:
return d[:length]
--- a/mercurial/ui.py Tue Nov 01 15:37:00 2011 -0500
+++ b/mercurial/ui.py Thu Nov 03 11:24:55 2011 -0500
@@ -79,6 +79,7 @@
try:
cfg.read(filename, fp, sections=sections, remap=remap)
+ fp.close()
except error.ConfigError, inst:
if trusted:
raise