Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5eb4f59

Browse files
committed
Issue #19437: Fix init_builtin(), handle _PyImport_FindExtensionObject()
failure
1 parent 46ef319 commit 5eb4f59

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

Python/import.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -948,8 +948,12 @@ static int
948948
init_builtin(PyObject *name)
949949
{
950950
struct _inittab *p;
951+
PyObject *mod;
951952

952-
if (_PyImport_FindExtensionObject(name, name) != NULL)
953+
mod = _PyImport_FindExtensionObject(name, name);
954+
if (PyErr_Occurred())
955+
return -1;
956+
if (mod != NULL)
953957
return 1;
954958

955959
for (p = PyImport_Inittab; p->name != NULL; p++) {

0 commit comments

Comments
 (0)