Skip to content

Commit d544285

Browse files
authored
gh-112087: Remove duplicated critical_section (gh-114268)
1 parent 72abb8c commit d544285

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

Objects/listobject.c

+3-6
Original file line numberDiff line numberDiff line change
@@ -816,13 +816,10 @@ static PyObject *
816816
list_insert_impl(PyListObject *self, Py_ssize_t index, PyObject *object)
817817
/*[clinic end generated code: output=7f35e32f60c8cb78 input=b1987ca998a4ae2d]*/
818818
{
819-
PyObject *ret = Py_None;
820-
Py_BEGIN_CRITICAL_SECTION(self);
821-
if (ins1(self, index, object) < 0) {
822-
ret = NULL;
819+
if (ins1(self, index, object) == 0) {
820+
Py_RETURN_NONE;
823821
}
824-
Py_END_CRITICAL_SECTION();
825-
return ret;
822+
return NULL;
826823
}
827824

828825
/*[clinic input]

0 commit comments

Comments
 (0)