From: Tim Peters Date: Mon, 2 Aug 2004 03:59:57 +0000 (+0000) Subject: Removed reliance on damaged module object appearing in sys.modules X-Git-Tag: v2.4a2~78 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=99d001ed0d81612418eab32ed2488a9367527e9a;p=python Removed reliance on damaged module object appearing in sys.modules after a failed import. This is the last checkin in the "change import failure semantics" series. --- diff --git a/Lib/test/test_pkgimport.py b/Lib/test/test_pkgimport.py index 1343173cc9..c87c342b75 100644 --- a/Lib/test/test_pkgimport.py +++ b/Lib/test/test_pkgimport.py @@ -66,12 +66,11 @@ class TestImport(unittest.TestCase): try: __import__(self.module_name) except NameError: pass else: raise RuntimeError, 'Failed to induce NameError.' - module = __import__(self.module_name).foo # ...now change the module so that the NameError doesn't # happen self.rewrite_file('%s = 1' % var) - reload(module) + module = __import__(self.module_name).foo self.assertEqual(getattr(module, var), 1)