diff Python/import.c @ 87107:f7d401eaee0e

Issue #19437: Fix init_builtin(), handle _PyImport_FindExtensionObject() failure
author Victor Stinner <victor.stinner@gmail.com>
date Thu, 14 Nov 2013 22:38:52 +0100
parents 8e40d07d3cd2
children 07229c6104b1
line wrap: on
line diff
--- a/Python/import.c	Thu Nov 14 22:31:41 2013 +0100
+++ b/Python/import.c	Thu Nov 14 22:38:52 2013 +0100
@@ -948,8 +948,12 @@
 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++) {