Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8cbc51a

Browse files
Py_SIZE() was misused for dict.
2 parents a24dca6 + a675842 commit 8cbc51a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Modules/_json.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1609,7 +1609,7 @@ encoder_listencode_dict(PyEncoderObject *s, _PyAccu *acc,
16091609
if (open_dict == NULL || close_dict == NULL || empty_dict == NULL)
16101610
return -1;
16111611
}
1612-
if (Py_SIZE(dct) == 0)
1612+
if (PyDict_GET_SIZE(dct) == 0) /* Fast path */
16131613
return _PyAccu_Accumulate(acc, empty_dict);
16141614

16151615
if (s->markers != Py_None) {

0 commit comments

Comments
 (0)