[3.13] Clean up redundant ifdef in list getitem (GH-128257) (#128276)

Clean up redundant ifdef in list getitem (GH-128257)

It's already inside a `Py_GIL_DISABLED` block so the `#else` clause is always unused.
(cherry picked from commit 42f7a00ae8)

Co-authored-by: da-woods <dw-git@d-woods.co.uk>
This commit is contained in:
Miss Islington (bot) 2024-12-26 16:04:32 +01:00 committed by GitHub
parent c30cad0638
commit 4f59f1d0d3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -373,11 +373,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;