mirror of
https://github.com/python/cpython.git
synced 2025-10-21 14:12:27 +00:00
Issue #19437: Fix init_builtin(), handle _PyImport_FindExtensionObject()
failure
This commit is contained in:
parent
46ef31953e
commit
5eb4f59cd9
1 changed files with 5 additions and 1 deletions
|
@ -948,8 +948,12 @@ static int
|
||||||
init_builtin(PyObject *name)
|
init_builtin(PyObject *name)
|
||||||
{
|
{
|
||||||
struct _inittab *p;
|
struct _inittab *p;
|
||||||
|
PyObject *mod;
|
||||||
|
|
||||||
if (_PyImport_FindExtensionObject(name, name) != NULL)
|
mod = _PyImport_FindExtensionObject(name, name);
|
||||||
|
if (PyErr_Occurred())
|
||||||
|
return -1;
|
||||||
|
if (mod != NULL)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
for (p = PyImport_Inittab; p->name != NULL; p++) {
|
for (p = PyImport_Inittab; p->name != NULL; p++) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue