Skip to content

Commit 7b42cb8

Browse files
corona10aisk
authored andcommitted
pythongh-112087: Remove duplicated critical_section (pythongh-114268)
1 parent 374909e commit 7b42cb8

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

Objects/listobject.c

Lines changed: 3 additions & 6 deletions
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)