]> granicus.if.org Git - python/commitdiff
Conditionalize test cleanup code to eliminate traceback, which will
authorR. David Murray <rdmurray@bitdance.com>
Thu, 9 Jul 2009 01:43:41 +0000 (01:43 +0000)
committerR. David Murray <rdmurray@bitdance.com>
Thu, 9 Jul 2009 01:43:41 +0000 (01:43 +0000)
hopefully reveal the real problem.

Lib/test/test_import.py

index ea15f011b46d951b01f8412e4742e4dfd424d748..ac6cbf297a2fc7762f1ebce4927a3544c3285092 100644 (file)
@@ -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