diff Python/importdl.c @ 84538:fce581643cb6 3.3

Issue #18426: improve exception message. Courtesy of Amaury
author Christian Heimes <christian@cheimes.de>
date Thu, 11 Jul 2013 13:02:30 +0200
parents 4343dfaca8e2
children 479af6ca3a3c
line wrap: on
line diff
--- a/Python/importdl.c	Thu Jul 11 11:22:21 2013 +0200
+++ b/Python/importdl.c	Thu Jul 11 13:02:30 2013 +0200
@@ -97,8 +97,12 @@
 
     /* Remember pointer to module init function. */
     def = PyModule_GetDef(m);
-    if (def == NULL)
+    if (def == NULL) {
+        PyErr_Format(PyExc_SystemError,
+                     "initialization of %s did not return an extension "
+                     "module", shortname);
         goto error;
+    }
     def->m_base.m_init = p;
 
     /* Remember the filename as the __file__ attribute */