]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-112087: Remove duplicated critical_section (gh-114268)
authorDonghee Na <donghee.na@python.org>
Thu, 18 Jan 2024 23:03:28 +0000 (08:03 +0900)
committerGitHub <noreply@github.com>
Thu, 18 Jan 2024 23:03:28 +0000 (23:03 +0000)
Objects/listobject.c

index 79ef8f532fbb98b10af7cc3a3606c355ea5628e5..401d1026133f4e17957fefe102765d01fd7f72f8 100644 (file)
@@ -816,13 +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;
-    Py_BEGIN_CRITICAL_SECTION(self);
-    if (ins1(self, index, object) < 0) {
-        ret = NULL;
+    if (ins1(self, index, object) == 0) {
+        Py_RETURN_NONE;
     }
-    Py_END_CRITICAL_SECTION();
-    return ret;
+    return NULL;
 }
 
 /*[clinic input]