Skip to content

Commit 820b543

Browse files
committed
remove our patch to importlib
1 parent 28632d1 commit 820b543

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

graalpython/lib-python/3/importlib/_bootstrap.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -985,22 +985,6 @@ def _find_and_load_unlocked(name, import_):
985985

986986
def _find_and_load(name, import_):
987987
"""Find and load the module."""
988-
# (tfel) Truffle change: CPython actually tests if name is in sys.modules
989-
# *before* ever calling this function (see the "optimization" in import.c
990-
# PyImport_ImportModuleLevelObject). Afaict, this "optimization" is the only
991-
# thing that avoids a deadlock situation tested for in
992-
# test_threaded_import.py#test_circular_imports.
993-
module = sys.modules.get(name, _NEEDS_LOADING)
994-
if module is not _NEEDS_LOADING and module is not None:
995-
# (tfel): the C code now calls import_ensure_initialized - this reads
996-
# the __spec__._initializing field and only calls _lock_unlock_module if
997-
# that is true. Note that it uses _PyModuleSpec_IsInitializing to read
998-
# __spec__._initializing, which ignores any error while reading either
999-
# __spec__ or _initializing.
1000-
if getattr(getattr(module, "__spec__", None), "_initializing", None):
1001-
_lock_unlock_module(name)
1002-
return module
1003-
1004988
with _ModuleLockManager(name):
1005989
module = sys.modules.get(name, _NEEDS_LOADING)
1006990
if module is _NEEDS_LOADING:

0 commit comments

Comments
 (0)