Skip to content

Commit

Permalink
Clean up redundant ifdef in list getitem (#128257)
Browse files Browse the repository at this point in the history
It's already inside a `Py_GIL_DISABLED` block so the `#else` clause is always unused.
  • Loading branch information
da-woods authored Dec 26, 2024
1 parent 8a26c7b commit 42f7a00
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 @@ -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;
Expand Down

0 comments on commit 42f7a00

Please sign in to comment.