summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/tests/test_config.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/distutils/tests/test_config.py')
-rw-r--r--Lib/distutils/tests/test_config.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/distutils/tests/test_config.py b/Lib/distutils/tests/test_config.py
index 71c6367..6a45a32 100644
--- a/Lib/distutils/tests/test_config.py
+++ b/Lib/distutils/tests/test_config.py
@@ -105,8 +105,12 @@ class PyPIRCCommandTestCase(support.TempdirManager,
self.assertTrue(not os.path.exists(rc))
cmd._store_pypirc('tarek', 'xxx')
self.assertTrue(os.path.exists(rc))
- content = open(rc).read()
- self.assertEquals(content, WANTED)
+ f = open(rc)
+ try:
+ content = f.read()
+ self.assertEquals(content, WANTED)
+ finally:
+ f.close()
def test_suite():
return unittest.makeSuite(PyPIRCCommandTestCase)