mirror of
https://github.com/python/cpython.git
synced 2025-08-31 22:18:28 +00:00
Issue #19437: Fix PyImport_ImportModuleLevelObject(), handle
PyUnicode_Substring() failure (ex: MemoryError)
This commit is contained in:
parent
d3e83e2a3e
commit
22af2599a9
1 changed files with 4 additions and 0 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue