Skip to content

Commit b179da2

Browse files
committed
Re-enable eagerly returning imported module
1 parent 9be59ec commit b179da2

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Python/import.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4256,10 +4256,9 @@ _PyImport_LazyImportModuleLevelObject(PyThreadState *tstate,
42564256
PyObject *mod = PyImport_GetModule(abs_name);
42574257
bool already_exists = mod != NULL;
42584258
Py_XDECREF(mod);
4259-
//if (mod != NULL) {
4260-
// Py_DECREF(abs_name);
4261-
// return mod;
4262-
//}
4259+
if (mod != NULL) {
4260+
return PyImport_ImportModuleLevelObject(name, globals, locals, fromlist, level);
4261+
}
42634262

42644263
// Check if the filter disables the lazy import
42654264
PyObject *filter = LAZY_IMPORTS_FILTER(interp);

0 commit comments

Comments
 (0)