]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Clean up redundant ifdef in list getitem (#128257)
authorda-woods <dw-git@d-woods.co.uk>
Thu, 26 Dec 2024 14:40:48 +0000 (14:40 +0000)
committerGitHub <noreply@github.com>
Thu, 26 Dec 2024 14:40:48 +0000 (14:40 +0000)
It's already inside a `Py_GIL_DISABLED` block so the `#else` clause is always unused.

Objects/listobject.c

index a877bad66be45f3d6f653b5a9fefef64335691f3..bbd53e7de94a31a597b8315ce01ce9b814ba79e9 100644 (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;