Skip to content

Commit

Permalink
[3.13] Clean up redundant ifdef in list getitem (GH-128257) (#128276)
Browse files Browse the repository at this point in the history
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 42f7a00)

Co-authored-by: da-woods <[email protected]>
  • Loading branch information
miss-islington and da-woods authored Dec 26, 2024
1 parent c30cad0 commit 4f59f1d
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions Objects/listobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4f59f1d

Please sign in to comment.