summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorRaymond Hettinger <rhettinger@users.noreply.github.com>2018-01-28 17:40:24 (GMT)
committerGitHub <noreply@github.com>2018-01-28 17:40:24 (GMT)
commita4d00012565d716db6e6abe1b8f33eaaa4de416e (patch)
tree81da58a66bc351914cb94760250b66968bc3f185 /Objects
parent059f58ce938d9c3f0286412a4efb1b9131339421 (diff)
downloadcpython-a4d00012565d716db6e6abe1b8f33eaaa4de416e.zip
cpython-a4d00012565d716db6e6abe1b8f33eaaa4de416e.tar.gz
cpython-a4d00012565d716db6e6abe1b8f33eaaa4de416e.tar.bz2
bpo-32690: Preserve order of locals() (#5379)
Diffstat (limited to 'Objects')
-rw-r--r--Objects/frameobject.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/frameobject.c b/Objects/frameobject.c
index 1ac3d75..3083e5b 100644
--- a/Objects/frameobject.c
+++ b/Objects/frameobject.c
@@ -791,7 +791,7 @@ map_to_dict(PyObject *map, Py_ssize_t nmap, PyObject *dict, PyObject **values,
assert(PyTuple_Check(map));
assert(PyDict_Check(dict));
assert(PyTuple_Size(map) >= nmap);
- for (j = nmap; --j >= 0; ) {
+ for (j=0; j < nmap; j++) {
PyObject *key = PyTuple_GET_ITEM(map, j);
PyObject *value = values[j];
assert(PyUnicode_Check(key));
@@ -844,7 +844,7 @@ dict_to_map(PyObject *map, Py_ssize_t nmap, PyObject *dict, PyObject **values,
assert(PyTuple_Check(map));
assert(PyDict_Check(dict));
assert(PyTuple_Size(map) >= nmap);
- for (j = nmap; --j >= 0; ) {
+ for (j=0; j < nmap; j++) {
PyObject *key = PyTuple_GET_ITEM(map, j);
PyObject *value = PyObject_GetItem(dict, key);
assert(PyUnicode_Check(key));