Clean up redundant ifdef in list getitem (#128257)

It's already inside a `Py_GIL_DISABLED` block so the `#else` clause is always unused.
This commit is contained in:
da-woods 2024-12-26 14:40:48 +00:00 committed by GitHub
parent 8a26c7b2af
commit 42f7a00ae8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;