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
|
@ -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…
Reference in New Issue