Skip to content

Commit 7444b0c

Browse files
committed
Ensure lazy_imports=none or PYTHON_LAZY_IMPORTS=none override __lazy_modules__
1 parent 1b490e6 commit 7444b0c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Python/ceval.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3086,7 +3086,7 @@ _PyEval_LazyImportName(PyThreadState *tstate, PyObject *builtins,
30863086
break;
30873087
}
30883088

3089-
if (!lazy) {
3089+
if (!lazy && PyImport_GetLazyImportsMode() != PyImport_LAZY_NONE) {
30903090
// See if __lazy_modules__ forces this to be lazy.
30913091
lazy = check_lazy_import_compatibility(tstate, globals, name, level);
30923092
if (lazy < 0) {

0 commit comments

Comments
 (0)