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

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


https://hg.python.org/cpython/rev/f473fba49f1a
changeset:   106121:f473fba49f1a
branch:      3.5
parent:      106112:4a0e169edf76
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Fri Jan 13 08:34:34 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