diff options
author | Tim Peters <tim.peters@gmail.com> | 2004-08-02 03:59:57 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2004-08-02 03:59:57 (GMT) |
commit | 99d001ed0d81612418eab32ed2488a9367527e9a (patch) | |
tree | 77415714a6a3a1c11ea06fce614aaeeaa33eb056 /Lib/test/test_pkgimport.py | |
parent | 08138fdc7a6b417c6350b1c41fada770d73995a5 (diff) | |
download | cpython-99d001ed0d81612418eab32ed2488a9367527e9a.zip cpython-99d001ed0d81612418eab32ed2488a9367527e9a.tar.gz cpython-99d001ed0d81612418eab32ed2488a9367527e9a.tar.bz2 |
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.
Diffstat (limited to 'Lib/test/test_pkgimport.py')
-rw-r--r-- | Lib/test/test_pkgimport.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/test/test_pkgimport.py b/Lib/test/test_pkgimport.py index 1343173..c87c342 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) |