Re-enable eagerly returning imported module

This commit is contained in:
Dino Viehland 2025-09-29 12:43:43 -07:00
parent 9be59ecebd
commit b179da2cf5

View file

@ -4256,10 +4256,9 @@ _PyImport_LazyImportModuleLevelObject(PyThreadState *tstate,
PyObject *mod = PyImport_GetModule(abs_name); PyObject *mod = PyImport_GetModule(abs_name);
bool already_exists = mod != NULL; bool already_exists = mod != NULL;
Py_XDECREF(mod); Py_XDECREF(mod);
//if (mod != NULL) { if (mod != NULL) {
// Py_DECREF(abs_name); return PyImport_ImportModuleLevelObject(name, globals, locals, fromlist, level);
// return mod; }
//}
// Check if the filter disables the lazy import // Check if the filter disables the lazy import
PyObject *filter = LAZY_IMPORTS_FILTER(interp); PyObject *filter = LAZY_IMPORTS_FILTER(interp);