misc: adding missing file close() calls

Spotted by Victor Stinner <victor.stinner@haypocalc.com>
This commit is contained in:
Matt Mackall 2011-11-03 11:24:55 -05:00
parent bd626658e2
commit 864ce9da04
3 changed files with 3 additions and 0 deletions

View File

@ -78,6 +78,7 @@ def ignore(root, files, warn):
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:

View File

@ -800,6 +800,7 @@ class revlog(object):
readahead = max(65536, length)
df.seek(offset)
d = df.read(readahead)
df.close()
self._addchunk(offset, d)
if readahead > length:
return d[:length]

View File

@ -79,6 +79,7 @@ class ui(object):
try:
cfg.read(filename, fp, sections=sections, remap=remap)
fp.close()
except error.ConfigError, inst:
if trusted:
raise