mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
bpo-31492: Fix assertion failures in case of a module with a bad __name__ attribute. (#3620)
This commit is contained in:
parent
453408a505
commit
6db7033192
4 changed files with 20 additions and 4 deletions
|
@ -4930,6 +4930,10 @@ import_from(PyObject *v, PyObject *name)
|
|||
if (pkgname == NULL) {
|
||||
goto error;
|
||||
}
|
||||
if (!PyUnicode_Check(pkgname)) {
|
||||
Py_CLEAR(pkgname);
|
||||
goto error;
|
||||
}
|
||||
fullmodname = PyUnicode_FromFormat("%U.%U", pkgname, name);
|
||||
if (fullmodname == NULL) {
|
||||
Py_DECREF(pkgname);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue