Py_SIZE() was misused for dict.

This commit is contained in:
Serhiy Storchaka 2017-01-13 08:37:05 +02:00
commit a6758427fd
1 changed files with 1 additions and 1 deletions

View File

@ -1609,7 +1609,7 @@ encoder_listencode_dict(PyEncoderObject *s, _PyAccu *acc,
if (open_dict == NULL || close_dict == NULL || empty_dict == NULL) if (open_dict == NULL || close_dict == NULL || empty_dict == NULL)
return -1; return -1;
} }
if (Py_SIZE(dct) == 0) if (PyDict_Size(dct) == 0) /* Fast path */
return _PyAccu_Accumulate(acc, empty_dict); return _PyAccu_Accumulate(acc, empty_dict);
if (s->markers != Py_None) { if (s->markers != Py_None) {