Forgot a case where the locals can now be a general mapping

instead of just a dictionary.  (backporting...)
This commit is contained in:
Armin Rigo 2006-11-29 21:59:22 +00:00
parent ef583a4992
commit 7037085959
1 changed files with 3 additions and 1 deletions

View File

@ -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)