summaryrefslogtreecommitdiffstats
path: root/Include/internal/pycore_list.h
diff options
context:
space:
mode:
Diffstat (limited to 'Include/internal/pycore_list.h')
-rw-r--r--Include/internal/pycore_list.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/Include/internal/pycore_list.h b/Include/internal/pycore_list.h
index 056be2c..55d67b3 100644
--- a/Include/internal/pycore_list.h
+++ b/Include/internal/pycore_list.h
@@ -51,8 +51,8 @@ _PyList_AppendTakeRef(PyListObject *self, PyObject *newitem)
Py_ssize_t allocated = self->allocated;
assert((size_t)len + 1 < PY_SSIZE_T_MAX);
if (allocated > len) {
- Py_SET_SIZE(self, len + 1);
PyList_SET_ITEM(self, len, newitem);
+ Py_SET_SIZE(self, len + 1);
return 0;
}
return _PyList_AppendTakeRefListResize(self, newitem);