diff --git a/Objects/listobject.c b/Objects/listobject.c index a877bad66be45f..bbd53e7de94a31 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -335,11 +335,7 @@ list_item_impl(PyListObject *self, Py_ssize_t idx) if (!valid_index(idx, size)) { goto exit; } -#ifdef Py_GIL_DISABLED item = _Py_NewRefWithLock(self->ob_item[idx]); -#else - item = Py_NewRef(self->ob_item[idx]); -#endif exit: Py_END_CRITICAL_SECTION(); return item;