diff options
Diffstat (limited to 'Lib/distutils/tests/test_config.py')
-rw-r--r-- | Lib/distutils/tests/test_config.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/distutils/tests/test_config.py b/Lib/distutils/tests/test_config.py index 0a1bb96..6c85efad 100644 --- a/Lib/distutils/tests/test_config.py +++ b/Lib/distutils/tests/test_config.py @@ -108,8 +108,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) |