From: Serhiy Storchaka Date: Fri, 13 Jan 2017 06:38:15 +0000 (+0200) Subject: Py_SIZE() was misused for dict. X-Git-Tag: v3.7.0a1~1570 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8cbc51ab3d9be00ddc296513d6f39b06b2d6b1a1;p=python Py_SIZE() was misused for dict. --- 8cbc51ab3d9be00ddc296513d6f39b06b2d6b1a1 diff --cc Modules/_json.c index d3fb7843cf,faa213491b..941f36343d --- a/Modules/_json.c +++ b/Modules/_json.c @@@ -1609,7 -1609,7 +1609,7 @@@ encoder_listencode_dict(PyEncoderObjec if (open_dict == NULL || close_dict == NULL || empty_dict == NULL) return -1; } - if (Py_SIZE(dct) == 0) - if (PyDict_Size(dct) == 0) /* Fast path */ ++ if (PyDict_GET_SIZE(dct) == 0) /* Fast path */ return _PyAccu_Accumulate(acc, empty_dict); if (s->markers != Py_None) {