From: R. David Murray Date: Thu, 9 Jul 2009 01:43:41 +0000 (+0000) Subject: Conditionalize test cleanup code to eliminate traceback, which will X-Git-Tag: v2.7a1~815 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8a624a9eb0cc036442d4ea4ffc026d1694f2fb25;p=python Conditionalize test cleanup code to eliminate traceback, which will hopefully reveal the real problem. --- diff --git a/Lib/test/test_import.py b/Lib/test/test_import.py index ea15f011b4..ac6cbf297a 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