diff options
author | Éric Araujo <merwok@netwok.org> | 2010-11-06 02:58:56 (GMT) |
---|---|---|
committer | Éric Araujo <merwok@netwok.org> | 2010-11-06 02:58:56 (GMT) |
commit | c6d7ead095fdd3b1ee82a338d4ffd88b2c2c2fce (patch) | |
tree | 87bd3d5006d1f4050f64a44c59910461747f08dc /Lib/distutils/tests/test_sysconfig.py | |
parent | 997980fe13ae7952665da56b122aeff9ea8fa6df (diff) | |
download | cpython-c6d7ead095fdd3b1ee82a338d4ffd88b2c2c2fce.zip cpython-c6d7ead095fdd3b1ee82a338d4ffd88b2c2c2fce.tar.gz cpython-c6d7ead095fdd3b1ee82a338d4ffd88b2c2c2fce.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_sysconfig.py')
-rw-r--r-- | Lib/distutils/tests/test_sysconfig.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/Lib/distutils/tests/test_sysconfig.py b/Lib/distutils/tests/test_sysconfig.py index edc755e..78bce94 100644 --- a/Lib/distutils/tests/test_sysconfig.py +++ b/Lib/distutils/tests/test_sysconfig.py @@ -75,9 +75,11 @@ class SysconfigTestCase(support.EnvironGuard, def test_parse_makefile_base(self): self.makefile = TESTFN fd = open(self.makefile, 'w') - fd.write(r"CONFIG_ARGS= '--arg1=optarg1' 'ENV=LIB'" '\n') - fd.write('VAR=$OTHER\nOTHER=foo') - fd.close() + try: + fd.write(r"CONFIG_ARGS= '--arg1=optarg1' 'ENV=LIB'" '\n') + fd.write('VAR=$OTHER\nOTHER=foo') + finally: + fd.close() d = sysconfig.parse_makefile(self.makefile) self.assertEquals(d, {'CONFIG_ARGS': "'--arg1=optarg1' 'ENV=LIB'", 'OTHER': 'foo'}) @@ -85,9 +87,11 @@ class SysconfigTestCase(support.EnvironGuard, def test_parse_makefile_literal_dollar(self): self.makefile = TESTFN fd = open(self.makefile, 'w') - fd.write(r"CONFIG_ARGS= '--arg1=optarg1' 'ENV=\$$LIB'" '\n') - fd.write('VAR=$OTHER\nOTHER=foo') - fd.close() + try: + fd.write(r"CONFIG_ARGS= '--arg1=optarg1' 'ENV=\$$LIB'" '\n') + fd.write('VAR=$OTHER\nOTHER=foo') + finally: + fd.close() d = sysconfig.parse_makefile(self.makefile) self.assertEquals(d, {'CONFIG_ARGS': r"'--arg1=optarg1' 'ENV=\$LIB'", 'OTHER': 'foo'}) |