diff options
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'}) |