summaryrefslogtreecommitdiffstats
path: root/Modules/_json.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-01-13 06:34:34 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2017-01-13 06:34:34 (GMT)
commit3023ebb43f7607584c3e123aff56e867cb04a418 (patch)
treea3489712ed3292964f67b22cbeafbeefcbed902f /Modules/_json.c
parentcb19aeb5500074a954a68dd54c7c3648b0887f08 (diff)
downloadcpython-3023ebb43f7607584c3e123aff56e867cb04a418.zip
cpython-3023ebb43f7607584c3e123aff56e867cb04a418.tar.gz
cpython-3023ebb43f7607584c3e123aff56e867cb04a418.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 47c9b0d..8cbf2e4 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_Size(dct) == 0) /* Fast path */
return _PyAccu_Accumulate(acc, empty_dict);
if (s->markers != Py_None) {