mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 07:17:55 +03:00
misc: adding missing file close() calls
Spotted by Victor Stinner <victor.stinner@haypocalc.com>
This commit is contained in:
parent
bd626658e2
commit
864ce9da04
@ -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:
|
||||
|
@ -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]
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user