Skip to content

Commit 905549a

Browse files
committed
Re-add removed check
1 parent 76fd124 commit 905549a

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

Lib/importlib/_bootstrap.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1309,6 +1309,10 @@ def _find_and_load_unlocked(name, import_):
13091309
if parent:
13101310
if parent not in sys.modules:
13111311
_call_with_frames_removed(import_, parent)
1312+
# Crazy side-effects!
1313+
module = sys.modules.get(name)
1314+
if module is not None:
1315+
return module
13121316
parent_module = sys.modules[parent]
13131317
try:
13141318
path = parent_module.__path__
@@ -1318,7 +1322,7 @@ def _find_and_load_unlocked(name, import_):
13181322
parent_spec = parent_module.__spec__
13191323
if getattr(parent_spec, '_initializing', False):
13201324
_call_with_frames_removed(import_, parent)
1321-
# Crazy side-effects!
1325+
# Crazy side-effects (again)!
13221326
module = sys.modules.get(name)
13231327
if module is not None:
13241328
return module

0 commit comments

Comments
 (0)