Always close files in distutils code and tests (#10252).

This commit is contained in:
Éric Araujo 2010-11-05 23:51:56 +00:00
parent afb078dd26
commit bee5cef7db
24 changed files with 261 additions and 171 deletions

View file

@ -340,4 +340,8 @@ class bdist_wininst(Command):
sfix = ''
filename = os.path.join(directory, "wininst-%.1f%s.exe" % (bv, sfix))
return open(filename, "rb").read()
f = open(filename, "rb")
try:
return f.read()
finally:
f.close()