Message205510
This is actually a problem with importlib.reload() (which imp.reload() simply wraps). The attached patch provides a test that reproduces the error. I'll work on a fix ASAP.
Interestingly, the kind of failure depends on frozen vs. source importlib:
======================================================================
ERROR: test_reload_submodule (test.test_importlib.test_api.Frozen_ReloadTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "Lib/test/test_importlib/test_api.py", line 430, in test_reload_submodule
self.init.reload(ham)
File "Lib/importlib/__init__.py", line 161, in reload
methods.exec(module)
File "<frozen importlib._bootstrap>", line 1134, in exec
AttributeError: 'NoneType' object has no attribute 'name'
======================================================================
ERROR: test_reload_submodule (test.test_importlib.test_api.Source_ReloadTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "Lib/test/test_importlib/test_api.py", line 430, in test_reload_submodule
self.init.reload(ham)
File "Lib/importlib/__init__.py", line 158, in reload
raise ImportError(msg.format(parent_name), name=parent_name)
ImportError: parent 'spam' not in sys.modules
---------------------------------------------------------------------- |
|
Date |
User |
Action |
Args |
2013-12-08 03:27:44 | eric.snow | set | recipients:
+ eric.snow, brett.cannon, ronaldoussoren, ncoghlan, Arfrever |
2013-12-08 03:27:44 | eric.snow | set | messageid: <1386473264.24.0.144679680995.issue19851@psf.upfronthosting.co.za> |
2013-12-08 03:27:44 | eric.snow | link | issue19851 messages |
2013-12-08 03:27:43 | eric.snow | create | |
|