diff options
Diffstat (limited to 'Lib/distutils/command/bdist_wininst.py')
-rw-r--r-- | Lib/distutils/command/bdist_wininst.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/distutils/command/bdist_wininst.py b/Lib/distutils/command/bdist_wininst.py index 3aa1dac..b2e2fc6 100644 --- a/Lib/distutils/command/bdist_wininst.py +++ b/Lib/distutils/command/bdist_wininst.py @@ -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() |