Skip to content

Commit 4f59f1d

Browse files
[3.13] Clean up redundant ifdef in list getitem (pythonGH-128257) (python#128276)
Clean up redundant ifdef in list getitem (pythonGH-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]>
1 parent c30cad0 commit 4f59f1d

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
@@ -373,11 +373,7 @@ list_item_impl(PyListObject *self, Py_ssize_t idx)
373373
if (!valid_index(idx, size)) {
374374
goto exit;
375375
}
376-
#ifdef Py_GIL_DISABLED
377376
item = _Py_NewRefWithLock(self->ob_item[idx]);
378-
#else
379-
item = Py_NewRef(self->ob_item[idx]);
380-
#endif
381377
exit:
382378
Py_END_CRITICAL_SECTION();
383379
return item;

0 commit comments

Comments
 (0)