mirror of
https://github.com/python/cpython.git
synced 2026-05-06 12:49:07 -04:00
gh-144851: Fix __lazy_import__ crash with user-defined filters (#144852)
This commit is contained in:
@@ -4512,6 +4512,10 @@ _PyImport_LazyImportModuleLevelObject(PyThreadState *tstate,
|
||||
assert(!PyErr_Occurred());
|
||||
modname = Py_NewRef(Py_None);
|
||||
}
|
||||
if (fromlist == NULL) {
|
||||
assert(!PyErr_Occurred());
|
||||
fromlist = Py_NewRef(Py_None);
|
||||
}
|
||||
PyObject *args[] = {modname, name, fromlist};
|
||||
PyObject *res = PyObject_Vectorcall(filter, args, 3, NULL);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user