From 5eb4f59cd91218f5a5597d39472ea048ef27169e Mon Sep 17 00:00:00 2001
From: Victor Stinner <victor.stinner@gmail.com>
Date: Thu, 14 Nov 2013 22:38:52 +0100
Subject: Issue #19437: Fix init_builtin(), handle
 _PyImport_FindExtensionObject() failure

---
 Python/import.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/Python/import.c b/Python/import.c
index ad181a2..f0ac051 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++) {
-- 
cgit v0.12