mirror of
https://github.com/python/cpython.git
synced 2026-04-13 23:31:02 +00:00
gh-144851: Fix __lazy_import__ crash with user-defined filters (#144852)
This commit is contained in:
parent
3b276f3f59
commit
8bcb3eaa67
2 changed files with 9 additions and 0 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue