From: Christian Heimes Date: Thu, 11 Jul 2013 11:02:30 +0000 (+0200) Subject: Issue #18426: improve exception message. Courtesy of Amaury X-Git-Tag: v3.4.0a1~264^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7ce57d67c925be894486ff6e3a6e330a1986cdcd;p=thirdparty%2FPython%2Fcpython.git Issue #18426: improve exception message. Courtesy of Amaury --- diff --git a/Python/importdl.c b/Python/importdl.c index e393de153bae..0ea954cae0a8 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 */