mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
Issue #18426: improve exception message. Courtesy of Amaury
This commit is contained in:
parent
848ee099f5
commit
7ce57d67c9
1 changed files with 5 additions and 1 deletions
|
|
@ -97,8 +97,12 @@ _PyImport_LoadDynamicModule(PyObject *name, PyObject *path, FILE *fp)
|
||||||
|
|
||||||
/* Remember pointer to module init function. */
|
/* Remember pointer to module init function. */
|
||||||
def = PyModule_GetDef(m);
|
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;
|
goto error;
|
||||||
|
}
|
||||||
def->m_base.m_init = p;
|
def->m_base.m_init = p;
|
||||||
|
|
||||||
/* Remember the filename as the __file__ attribute */
|
/* Remember the filename as the __file__ attribute */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue