]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] Clean up redundant ifdef in list getitem (GH-128257) (#128276)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 26 Dec 2024 15:04:32 +0000 (16:04 +0100)
committerGitHub <noreply@github.com>
Thu, 26 Dec 2024 15:04:32 +0000 (15:04 +0000)
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 42f7a00ae8b6b3fa09115e24b9512216c6c8978e)

Co-authored-by: da-woods <dw-git@d-woods.co.uk>
Objects/listobject.c

index ee53a8bddbed44e9dd9cf51a104e8d7809d1bf49..31ec8d5e05cf5066501697d2336782f7e991de36 100644 (file)
@@ -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;