There was an error while loading. Please reload this page.
1 parent e0889e9 commit 4401d0dCopy full SHA for 4401d0d
1 file changed
Modules/_testbuffer.c
@@ -337,11 +337,9 @@ pack_from_list(PyObject *obj, PyObject *items, PyObject *format,
337
offset = NULL;
338
for (i = 0; i < nitems; i++) {
339
/* Loop invariant: args[j] are borrowed references or NULL. */
340
- PyTuple_SetItemRef(args, 0, obj);
341
- Py_DECREF(obj);
342
- for (j = 1; j < 2+nmemb; j++) {
343
- PyTuple_SetItemRef(args, j, NULL);
344
- }
+ PyTuple_SET_ITEM(args, 0, obj);
+ for (j = 1; j < 2+nmemb; j++)
+ PyTuple_SET_ITEM(args, j, NULL);
345
346
Py_XDECREF(offset);
347
offset = PyLong_FromSsize_t(i*itemsize);
0 commit comments