mirror of
https://github.com/python/cpython
synced 2024-10-14 21:34:32 +00:00
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.
This commit is contained in:
parent
08138fdc7a
commit
99d001ed0d
|
@ -66,12 +66,11 @@ def test_package_import__semantics(self):
|
|||
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)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue