summaryrefslogtreecommitdiff
path: root/Python
diff options
context:
space:
mode:
Diffstat (limited to 'Python')
-rw-r--r--Python/import.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Python/import.c b/Python/import.c
index ad181a2942..f0ac0515a0 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -948,8 +948,12 @@ static int
init_builtin(PyObject *name)
{
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;
for (p = PyImport_Inittab; p->name != NULL; p++) {