Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Commit 3023ebb

Browse files
Py_SIZE() was misused for dict.
1 parent cb19aeb commit 3023ebb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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_Size(dct) == 0) /* Fast path */
16131613
return _PyAccu_Accumulate(acc, empty_dict);
16141614

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

0 commit comments

Comments
 (0)