Issue #19437: Fix PyImport_ImportModuleLevelObject(), handle

PyUnicode_Substring() failure (ex: MemoryError)
This commit is contained in:
Victor Stinner 2013-11-13 12:11:36 +01:00
parent d3e83e2a3e
commit 22af2599a9
1 changed files with 4 additions and 0 deletions

View File

@ -1364,7 +1364,11 @@ PyImport_ImportModuleLevelObject(PyObject *name, PyObject *given_globals,
goto error;
}
}
base = PyUnicode_Substring(package, 0, last_dot);
if (base == NULL)
goto error;
if (PyUnicode_GET_LENGTH(name) > 0) {
PyObject *borrowed_dot, *seq = NULL;