diff --git a/Lib/test/test_import.py b/Lib/test/test_import.py index fc3d00116e4..bdf94438e5c 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'