summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2006-11-29 22:07:38 (GMT)
committerArmin Rigo <arigo@tunes.org>2006-11-29 22:07:38 (GMT)
commiteff853ccd7e647d30db712fde1b82cfba09d276a (patch)
tree4df5985bb878e9bb7cf50c274497f050473f0e1e /Python
parent33d34e73c32c991c6627a145bffdb3f7d3becbab (diff)
downloadcpython-eff853ccd7e647d30db712fde1b82cfba09d276a.zip
cpython-eff853ccd7e647d30db712fde1b82cfba09d276a.tar.gz
cpython-eff853ccd7e647d30db712fde1b82cfba09d276a.tar.bz2
Backport of r52862.
Diffstat (limited to 'Python')
-rw-r--r--Python/ceval.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index b9000a6..358346c 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -4073,8 +4073,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)