summaryrefslogtreecommitdiff
path: root/Modules/_json.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-01-13 08:34:34 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2017-01-13 08:34:34 +0200
commit3023ebb43f7607584c3e123aff56e867cb04a418 (patch)
treea3489712ed3292964f67b22cbeafbeefcbed902f /Modules/_json.c
parentcb19aeb5500074a954a68dd54c7c3648b0887f08 (diff)
downloadcpython-git-3023ebb43f7607584c3e123aff56e867cb04a418.tar.gz
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 47c9b0d2f7..8cbf2e4058 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) {