Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8e54b1c

Browse files
committed
Issue #18408: Fix _PyImport_LoadDynamicModule(), handle PyUnicode_FromFormat() failure
1 parent 0fae8f9 commit 8e54b1c

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Python/importdl.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ _PyImport_LoadDynamicModule(PyObject *name, PyObject *path, FILE *fp)
7777
PyObject *msg = PyUnicode_FromFormat("dynamic module does not define "
7878
"init function (PyInit_%s)",
7979
shortname);
80+
if (msg == NULL)
81+
goto error;
8082
PyErr_SetImportError(msg, name, path);
8183
Py_DECREF(msg);
8284
goto error;

0 commit comments

Comments
 (0)