[Python-checkins] cpython (merge 3.5 -> 3.6): Py_SIZE() was misused for dict.

serhiy.storchaka python-checkins at python.org
Fri Jan 13 01:38:38 EST 2017


https://hg.python.org/cpython/rev/7f7f1cbbf608
changeset:   106122:7f7f1cbbf608
branch:      3.6
parent:      106115:29f74474b12a
parent:      106121:f473fba49f1a
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Fri Jan 13 08:37:05 2017 +0200
summary:
  Py_SIZE() was misused for dict.

files:
  Modules/_json.c |  2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/Modules/_json.c b/Modules/_json.c
--- a/Modules/_json.c
+++ b/Modules/_json.c
@@ -1609,7 +1609,7 @@
         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) {

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list