You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Lazy imports fail to reload an unloaded parent package #162346
With all imports made lazy, the existing regression test for a relative import
from an unloaded package fails:
./python -X lazy_imports=all -m test test_import -m test_import_from_unloaded_package -q
It raises KeyError: 'package2'. The test passes without -X lazy_imports=all.
package2.submodule1 removes package2 from sys.modules and then imports
another submodule relatively. The eager import reloads the missing parent, but
the lazy import tries to bind the child while the parent is still absent.
Activity