in dict displays, evaluate the key before the value (closes #11205)

Patch partially by Steve Dougherty.
This commit is contained in:
Benjamin Peterson 2015-05-28 14:30:26 -05:00
parent 44e625860b
commit ee85339cc6
6 changed files with 127 additions and 113 deletions

View file

@ -2584,8 +2584,8 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
goto error;
while (--oparg >= 0) {
int err;
PyObject *key = TOP();
PyObject *value = SECOND();
PyObject *value = TOP();
PyObject *key = SECOND();
STACKADJ(-2);
err = PyDict_SetItem(map, key, value);
Py_DECREF(value);