From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Thu, 26 Dec 2024 15:04:32 +0000 (+0100) Subject: [3.13] Clean up redundant ifdef in list getitem (GH-128257) (#128276) X-Git-Tag: v3.13.2~170 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4f59f1d0d31522483fd881af5de3dadc0121401b;p=thirdparty%2FPython%2Fcpython.git [3.13] Clean up redundant ifdef in list getitem (GH-128257) (#128276) 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 --- diff --git a/Objects/listobject.c b/Objects/listobject.c index ee53a8bddbed..31ec8d5e05cf 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -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;