From: Armin Rigo Date: Wed, 29 Nov 2006 21:59:22 +0000 (+0000) Subject: Forgot a case where the locals can now be a general mapping X-Git-Tag: v2.6a1~2399 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7037085959cbdb8717c342afe8bcfb7d2301c58d;p=python Forgot a case where the locals can now be a general mapping instead of just a dictionary. (backporting...) --- diff --git a/Python/ceval.c b/Python/ceval.c index 73e8dee790..7884051ffb 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -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)