diff options
Diffstat (limited to 'Python/ceval.c')
-rw-r--r-- | Python/ceval.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index 73e8dee..7884051 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) |