Skip to content

Commit 92d3f1a

Browse files
committed
gh-140009: Use PyTuple_FromArray in _json object_pairs_hook path
1 parent 945bf8c commit 92d3f1a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Modules/_json.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,8 @@ _parse_object_unicode(PyScannerObject *s, PyObject *memo, PyObject *pystr, Py_ss
806806
goto bail;
807807

808808
if (has_pairs_hook) {
809-
PyObject *item = PyTuple_Pack(2, key, val);
809+
PyObject *items[] = {key, val};
810+
PyObject *item = PyTuple_FromArray(items, 2);
810811
if (item == NULL)
811812
goto bail;
812813
Py_CLEAR(key);

0 commit comments

Comments
 (0)