From c40c59fec154d19cd1ae479cf6d806c789503592 Mon Sep 17 00:00:00 2001 From: Donghee Na Date: Fri, 19 Jan 2024 07:33:12 +0900 Subject: [PATCH 1/4] gh-112087: Remove duplicated critical_section --- Objects/listobject.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Objects/listobject.c b/Objects/listobject.c index 79ef8f532fbb98..13511efe6af6f6 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -817,11 +817,9 @@ list_insert_impl(PyListObject *self, Py_ssize_t index, PyObject *object) /*[clinic end generated code: output=7f35e32f60c8cb78 input=b1987ca998a4ae2d]*/ { PyObject *ret = Py_None; - Py_BEGIN_CRITICAL_SECTION(self); if (ins1(self, index, object) < 0) { - ret = NULL; + Py_RETURN_NONE } - Py_END_CRITICAL_SECTION(); return ret; } From ed0ea4b7c6433758056354dd462cca6e8b4b1e70 Mon Sep 17 00:00:00 2001 From: Donghee Na Date: Fri, 19 Jan 2024 07:36:08 +0900 Subject: [PATCH 2/4] fix --- Objects/listobject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Objects/listobject.c b/Objects/listobject.c index 13511efe6af6f6..7c6ee42f8ef746 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -817,7 +817,7 @@ list_insert_impl(PyListObject *self, Py_ssize_t index, PyObject *object) /*[clinic end generated code: output=7f35e32f60c8cb78 input=b1987ca998a4ae2d]*/ { PyObject *ret = Py_None; - if (ins1(self, index, object) < 0) { + if (ins1(self, index, object) == 0) { Py_RETURN_NONE } return ret; From 2d0dd6a8dcc941e0d47d5eed4d79bd7f56f53c9b Mon Sep 17 00:00:00 2001 From: Donghee Na Date: Fri, 19 Jan 2024 07:36:44 +0900 Subject: [PATCH 3/4] fix --- Objects/listobject.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Objects/listobject.c b/Objects/listobject.c index 7c6ee42f8ef746..8ce67425032de8 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -816,11 +816,10 @@ static PyObject * list_insert_impl(PyListObject *self, Py_ssize_t index, PyObject *object) /*[clinic end generated code: output=7f35e32f60c8cb78 input=b1987ca998a4ae2d]*/ { - PyObject *ret = Py_None; if (ins1(self, index, object) == 0) { Py_RETURN_NONE } - return ret; + return NULL; } /*[clinic input] From 1454d7f3d2f8640c56b9540c3e533fcc25ef95bc Mon Sep 17 00:00:00 2001 From: Donghee Na Date: Fri, 19 Jan 2024 07:38:50 +0900 Subject: [PATCH 4/4] Build fix --- Objects/listobject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Objects/listobject.c b/Objects/listobject.c index 8ce67425032de8..401d1026133f4e 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -817,7 +817,7 @@ list_insert_impl(PyListObject *self, Py_ssize_t index, PyObject *object) /*[clinic end generated code: output=7f35e32f60c8cb78 input=b1987ca998a4ae2d]*/ { if (ins1(self, index, object) == 0) { - Py_RETURN_NONE + Py_RETURN_NONE; } return NULL; }