summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/tests/test_install.py
diff options
context:
space:
mode:
authorÉric Araujo <merwok@netwok.org>2010-11-05 23:51:56 (GMT)
committerÉric Araujo <merwok@netwok.org>2010-11-05 23:51:56 (GMT)
commitbee5cef7dbff40734c347da5b93797e8db9103e8 (patch)
tree06dcc726207cfad3016f2b0f7c365fb9fe5b3cc6 /Lib/distutils/tests/test_install.py
parentafb078dd2673d919ac3733104757c441f256f30f (diff)
downloadcpython-bee5cef7dbff40734c347da5b93797e8db9103e8.zip
cpython-bee5cef7dbff40734c347da5b93797e8db9103e8.tar.gz
cpython-bee5cef7dbff40734c347da5b93797e8db9103e8.tar.bz2
Always close files in distutils code and tests (#10252).
Diffstat (limited to 'Lib/distutils/tests/test_install.py')
-rw-r--r--Lib/distutils/tests/test_install.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/distutils/tests/test_install.py b/Lib/distutils/tests/test_install.py
index 76fa02a..bc407cf 100644
--- a/Lib/distutils/tests/test_install.py
+++ b/Lib/distutils/tests/test_install.py
@@ -182,8 +182,11 @@ class InstallTestCase(support.TempdirManager,
# let's check the RECORD file was created with one
# line (the egg info file)
- with open(cmd.record) as f:
+ f = open(cmd.record)
+ try:
self.assertEquals(len(f.readlines()), 1)
+ finally:
+ f.close()
def test_debug_mode(self):
# this covers the code called when DEBUG is set