summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/command/bdist_wininst.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/distutils/command/bdist_wininst.py')
-rw-r--r--Lib/distutils/command/bdist_wininst.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/distutils/command/bdist_wininst.py b/Lib/distutils/command/bdist_wininst.py
index a31a5f7..36d46bd 100644
--- a/Lib/distutils/command/bdist_wininst.py
+++ b/Lib/distutils/command/bdist_wininst.py
@@ -356,5 +356,9 @@ 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()
# class bdist_wininst