Skip to content

Commit 42f7a00

Browse files
authored
Clean up redundant ifdef in list getitem (#128257)
It's already inside a `Py_GIL_DISABLED` block so the `#else` clause is always unused.
1 parent 8a26c7b commit 42f7a00

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

Objects/listobject.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -335,11 +335,7 @@ list_item_impl(PyListObject *self, Py_ssize_t idx)
335335
if (!valid_index(idx, size)) {
336336
goto exit;
337337
}
338-
#ifdef Py_GIL_DISABLED
339338
item = _Py_NewRefWithLock(self->ob_item[idx]);
340-
#else
341-
item = Py_NewRef(self->ob_item[idx]);
342-
#endif
343339
exit:
344340
Py_END_CRITICAL_SECTION();
345341
return item;

0 commit comments

Comments
 (0)