summaryrefslogtreecommitdiffstats
path: root/Modules/_json.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-01-13 06:38:15 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2017-01-13 06:38:15 (GMT)
commit8cbc51ab3d9be00ddc296513d6f39b06b2d6b1a1 (patch)
tree3e8b654f3593a4371a987e9893fe255d0e896a27 /Modules/_json.c
parenta24dca6a90774ed47fcb37bbe4315a7f8121e4a8 (diff)
parenta6758427fd96741c6a8a1506f933bb0107d2b0a7 (diff)
downloadcpython-8cbc51ab3d9be00ddc296513d6f39b06b2d6b1a1.zip
cpython-8cbc51ab3d9be00ddc296513d6f39b06b2d6b1a1.tar.gz
cpython-8cbc51ab3d9be00ddc296513d6f39b06b2d6b1a1.tar.bz2
Py_SIZE() was misused for dict.
Diffstat (limited to 'Modules/_json.c')
-rw-r--r--Modules/_json.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_json.c b/Modules/_json.c
index d3fb784..941f363 100644
--- a/Modules/_json.c
+++ b/Modules/_json.c
@@ -1609,7 +1609,7 @@ encoder_listencode_dict(PyEncoderObject *s, _PyAccu *acc,
if (open_dict == NULL || close_dict == NULL || empty_dict == NULL)
return -1;
}
- if (Py_SIZE(dct) == 0)
+ if (PyDict_GET_SIZE(dct) == 0) /* Fast path */
return _PyAccu_Accumulate(acc, empty_dict);
if (s->markers != Py_None) {