summaryrefslogtreecommitdiff
path: root/Objects/structseq.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/structseq.c')
-rw-r--r--Objects/structseq.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/Objects/structseq.c b/Objects/structseq.c
index 9a7013372e..100ccfef0a 100644
--- a/Objects/structseq.c
+++ b/Objects/structseq.c
@@ -200,8 +200,7 @@ structseq_new_impl(PyTypeObject *type, PyObject *arg, PyObject *dict)
}
for (i = 0; i < len; ++i) {
PyObject *v = PySequence_Fast_GET_ITEM(arg, i);
- Py_INCREF(v);
- res->ob_item[i] = v;
+ res->ob_item[i] = Py_NewRef(v);
}
Py_DECREF(arg);
for (; i < max_len; ++i) {
@@ -219,8 +218,7 @@ structseq_new_impl(PyTypeObject *type, PyObject *arg, PyObject *dict)
ob = Py_None;
}
}
- Py_INCREF(ob);
- res->ob_item[i] = ob;
+ res->ob_item[i] = Py_NewRef(ob);
}
_PyObject_GC_TRACK(res);