mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +00:00
Backport of r52862.
This commit is contained in:
parent
84a90cade5
commit
1bc1ab23d3
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);
|
value = PyObject_GetAttr(v, name);
|
||||||
if (value == NULL)
|
if (value == NULL)
|
||||||
err = -1;
|
err = -1;
|
||||||
else
|
else if (PyDict_CheckExact(locals))
|
||||||
err = PyDict_SetItem(locals, name, value);
|
err = PyDict_SetItem(locals, name, value);
|
||||||
|
else
|
||||||
|
err = PyObject_SetItem(locals, name, value);
|
||||||
Py_DECREF(name);
|
Py_DECREF(name);
|
||||||
Py_XDECREF(value);
|
Py_XDECREF(value);
|
||||||
if (err != 0)
|
if (err != 0)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue