Bug report
Bug description:
While working on setting up testing infra for lazy_imports=all, I came across this test failure in test_trace. It appears that after importing a submodule, deleting said submodule, and then lazy importing it again--the module doesn't make it's way back into sys.modules.
Example failing code snippet:
import sys
modname = "test.test_lazy_import.data.pkg.bar"
import test.test_lazy_import.data.pkg.bar
del sys.modules[modname]
lazy import test.test_lazy_import.data.pkg.bar # the issue is also seen when using lazy from
bar.f()
assert modname in sys.modules # False
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs
Bug report
Bug description:
While working on setting up testing infra for
lazy_imports=all, I came across this test failure in test_trace. It appears that after importing a submodule, deleting said submodule, and then lazy importing it again--the module doesn't make it's way back intosys.modules.Example failing code snippet:
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs