diff options
author | Éric Araujo <merwok@netwok.org> | 2010-11-06 04:06:18 (GMT) |
---|---|---|
committer | Éric Araujo <merwok@netwok.org> | 2010-11-06 04:06:18 (GMT) |
commit | d1feff70a3c08f91066b99a74ee1ca8f65bdfec1 (patch) | |
tree | 27144df6cefbb43ab305d380a584a81d7fb0b248 /Lib/distutils/tests/test_config.py | |
parent | 860c05d9f7fe7da7e9633c7aa24a9dbc07b048b7 (diff) | |
download | cpython-d1feff70a3c08f91066b99a74ee1ca8f65bdfec1.zip cpython-d1feff70a3c08f91066b99a74ee1ca8f65bdfec1.tar.gz cpython-d1feff70a3c08f91066b99a74ee1ca8f65bdfec1.tar.bz2 |
Merged revisions 86223-86224,86226,86234 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r86223 | eric.araujo | 2010-11-06 00:51:56 +0100 (sam., 06 nov. 2010) | 2 lines
Always close files in distutils code and tests (#10252).
........
r86224 | eric.araujo | 2010-11-06 00:58:34 +0100 (sam., 06 nov. 2010) | 2 lines
Add missing entry for r86223.
........
r86226 | eric.araujo | 2010-11-06 00:59:32 +0100 (sam., 06 nov. 2010) | 2 lines
Of course, I forgot one file in r86223.
........
r86234 | eric.araujo | 2010-11-06 03:10:32 +0100 (sam., 06 nov. 2010) | 2 lines
Also close file descriptors from os.popen and subprocess.Popen
........
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) |