[Python-checkins] cpython (merge 3.3 -> default): Issue #18426: improve exception message. Courtesy of Amaury

christian.heimes python-checkins at python.org
Thu Jul 11 13:03:49 CEST 2013


http://hg.python.org/cpython/rev/7a50d3c0aa61
changeset:   84539:7a50d3c0aa61
parent:      84537:9fb3656b178a
parent:      84538:fce581643cb6
user:        Christian Heimes <christian at cheimes.de>
date:        Thu Jul 11 13:02:37 2013 +0200
summary:
  Issue #18426: improve exception message. Courtesy of Amaury

files:
  Python/importdl.c |  6 +++++-
  1 files changed, 5 insertions(+), 1 deletions(-)


diff --git a/Python/importdl.c b/Python/importdl.c
--- a/Python/importdl.c
+++ b/Python/importdl.c
@@ -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 */

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list