We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
_PyImport_LazyImportModuleLevelObject
1 parent 74f35c4 commit 3014816Copy full SHA for 3014816
Python/import.c
@@ -4371,7 +4371,9 @@ _PyImport_LazyImportModuleLevelObject(PyThreadState *tstate,
4371
Py_DECREF(filter);
4372
Py_DECREF(abs_name);
4373
return NULL;
4374
- } else if (modname == NULL) {
+ }
4375
+ if (modname == NULL) {
4376
+ assert(!PyErr_Occurred());
4377
modname = Py_NewRef(Py_None);
4378
}
4379
PyObject *args[] = {modname, name, fromlist};
@@ -4405,6 +4407,7 @@ _PyImport_LazyImportModuleLevelObject(PyThreadState *tstate,
4405
4407
4406
4408
4409
4410
+ // here, 'filter' is either NULL or is equivalent to a borrowed reference
4411
PyObject *res = _PyLazyImport_New(builtins, abs_name, fromlist);
4412
if (res == NULL) {
4413
0 commit comments