From: Antoine Pitrou Date: Wed, 21 Dec 2011 15:01:53 +0000 (+0100) Subject: Fix test_import failure when run multiple times. X-Git-Tag: v2.7.3rc1~224 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=17c07134a9619d110ad53f7a202612bfc304864e;p=python Fix test_import failure when run multiple times. (2.7-only) --- diff --git a/Lib/test/test_import.py b/Lib/test/test_import.py index fc3d00116e..bdf94438e5 100644 --- a/Lib/test/test_import.py +++ b/Lib/test/test_import.py @@ -263,7 +263,10 @@ class ImportTests(unittest.TestCase): import imp sys.argv.insert(0, C()) """)) - script_helper.assert_python_ok(testfn) + try: + script_helper.assert_python_ok(testfn) + finally: + unlink(testfn) def test_bug7732(self): source = TESTFN + '.py'