Kaydet (Commit) 22af2599 authored tarafından Victor Stinner's avatar Victor Stinner

Issue #19437: Fix PyImport_ImportModuleLevelObject(), handle

PyUnicode_Substring() failure (ex: MemoryError)
üst d3e83e2a
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment