Message351738
The IMPORT_NAME bytecode has a fast path calling PyImport_ImportModuleLevelObject() that behaves differently from importlib. In particular, test_circular_imports() in test_threaded_import.py fails due to a _DeadlockError if you replace some import statements with importlib.import_module() as in
diff --git a/Lib/test/test_importlib/test_threaded_import.py b/Lib/test/test_importlib/test_threaded_import.py
index d1f64c7..243d2c1 100644
--- a/Lib/test/test_importlib/test_threaded_import.py
+++ b/Lib/test/test_importlib/test_threaded_import.py
@@ -60,8 +60,12 @@ circular_imports_modules = {
x = 'b'
import D
""",
- 'C': """import B""",
- 'D': """import A""",
+ 'C': """if 1:
+ import importlib
+ B = importlib.import_module('B')""",
+ 'D': """if 1:
+ import importlib
+ A = importlib.import_module('A')""",
} |
|
Date |
User |
Action |
Args |
2019-09-10 19:10:54 | Ronan.Lamy | set | recipients:
+ Ronan.Lamy |
2019-09-10 19:10:54 | Ronan.Lamy | set | messageid: <1568142654.85.0.849631704923.issue38095@roundup.psfhosted.org> |
2019-09-10 19:10:54 | Ronan.Lamy | link | issue38095 messages |
2019-09-10 19:10:54 | Ronan.Lamy | create | |
|