Skip to content

Commit d5d65ab

Browse files
committed
fix
1 parent 1920aed commit d5d65ab

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
@@ -1756,7 +1756,7 @@ _encoder_iterate_mapping_lock_held(PyEncoderObject *s, PyUnicodeWriter *writer,
17561756
PyObject *item = PyList_GET_ITEM(items, i);
17571757
#ifdef Py_GIL_DISABLED
17581758
// gh-119438: in the free-threading build the critical section on items can get suspended
1759-
Py_DECREF(item);
1759+
Py_INCREF(item);
17601760
#endif
17611761
if (!PyTuple_Check(item) || PyTuple_GET_SIZE(item) != 2) {
17621762
PyErr_SetString(PyExc_ValueError, "items must return 2-tuples");

0 commit comments

Comments
 (0)