https://github.com/python/cpython/commit/42f7a00ae8b6b3fa09115e24b9512216c6c8978e
commit: 42f7a00ae8b6b3fa09115e24b9512216c6c8978e
branch: main
author: da-woods <[email protected]>
committer: kumaraditya303 <[email protected]>
date: 2024-12-26T14:40:48Z
summary:

Clean up redundant ifdef in list getitem (#128257)

It's already inside a `Py_GIL_DISABLED` block so the `#else` clause is always 
unused.

files:
M Objects/listobject.c

diff --git a/Objects/listobject.c b/Objects/listobject.c
index a877bad66be45f..bbd53e7de94a31 100644
--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -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;

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to