Mercurial > cpython-lru_cache-weakref
diff Lib/test/test_pkgimport.py @ 32885:2aa7aef4e403 legacy-trunk
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.
| author | Tim Peters <tim.peters@gmail.com> |
|---|---|
| date | Mon, 02 Aug 2004 03:59:57 +0000 |
| parents | 11c701038805 |
| children | dba99828d91c 6768b2350c57 63237fcefd99 |
line wrap: on
line diff
--- a/Lib/test/test_pkgimport.py Mon Aug 02 03:58:27 2004 +0000 +++ b/Lib/test/test_pkgimport.py Mon Aug 02 03:59:57 2004 +0000 @@ -66,12 +66,11 @@ 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)
