summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2013-07-11 11:02:37 (GMT)
committerChristian Heimes <christian@cheimes.de>2013-07-11 11:02:37 (GMT)
commit6cee994674a77f73fd0bf79344c0c79021a0ea03 (patch)
tree4bfa4934e22338bbced6d50b5e71703fc42d35a5
parent5ec44649dfc2f5ec7daddcf33075b4b26b2e63d1 (diff)
parent7ce57d67c925be894486ff6e3a6e330a1986cdcd (diff)
downloadcpython-6cee994674a77f73fd0bf79344c0c79021a0ea03.zip
cpython-6cee994674a77f73fd0bf79344c0c79021a0ea03.tar.gz
cpython-6cee994674a77f73fd0bf79344c0c79021a0ea03.tar.bz2
Issue #18426: improve exception message. Courtesy of Amaury
-rw-r--r--Python/importdl.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Python/importdl.c b/Python/importdl.c
index e393de1..0ea954c 100644
--- a/Python/importdl.c
+++ b/Python/importdl.c
@@ -97,8 +97,12 @@ _PyImport_LoadDynamicModule(PyObject *name, PyObject *path, FILE *fp)
/* 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 */