From 8a624a9eb0cc036442d4ea4ffc026d1694f2fb25 Mon Sep 17 00:00:00 2001 From: "R. David Murray" Date: Thu, 9 Jul 2009 01:43:41 +0000 Subject: [PATCH] Conditionalize test cleanup code to eliminate traceback, which will hopefully reveal the real problem. --- Lib/test/test_import.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/test_import.py b/Lib/test/test_import.py index ea15f011b46..ac6cbf297a2 100644 --- a/Lib/test/test_import.py +++ b/Lib/test/test_import.py @@ -107,7 +107,7 @@ class ImportTest(unittest.TestCase): stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH) finally: remove_files(TESTFN) - del sys.modules[TESTFN] + if TESTFN in sys.modules: del sys.modules[TESTFN] def testImpModule(self): # Verify that the imp module can correctly load and find .py files