mirror of
https://github.com/python/cpython.git
synced 2025-07-28 05:34:31 +00:00
Forgot a case where the locals can now be a general mapping
instead of just a dictionary. (backporting...)
This commit is contained in:
parent
ef583a4992
commit
7037085959
1 changed files with 3 additions and 1 deletions
|
@ -4046,8 +4046,10 @@ import_all_from(PyObject *locals, PyObject *v)
|
|||
value = PyObject_GetAttr(v, name);
|
||||
if (value == NULL)
|
||||
err = -1;
|
||||
else
|
||||
else if (PyDict_CheckExact(locals))
|
||||
err = PyDict_SetItem(locals, name, value);
|
||||
else
|
||||
err = PyObject_SetItem(locals, name, value);
|
||||
Py_DECREF(name);
|
||||
Py_XDECREF(value);
|
||||
if (err != 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue