Issue #18408: Fix _PyImport_LoadDynamicModule(), handle PyUnicode_FromFormat() failure

This commit is contained in:
Victor Stinner 2013-07-17 21:53:23 +02:00
parent 0fae8f9083
commit 8e54b1c448
1 changed files with 2 additions and 0 deletions

View File

@ -77,6 +77,8 @@ _PyImport_LoadDynamicModule(PyObject *name, PyObject *path, FILE *fp)
PyObject *msg = PyUnicode_FromFormat("dynamic module does not define "
"init function (PyInit_%s)",
shortname);
if (msg == NULL)
goto error;
PyErr_SetImportError(msg, name, path);
Py_DECREF(msg);
goto error;