diff options
author | Donghee Na <donghee.na@python.org> | 2024-01-18 23:03:28 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-18 23:03:28 (GMT) |
commit | d5442851a6fad16ba32b62723c09e40a1392aa38 (patch) | |
tree | 8d48d55b2d26321cd45a62b7e422b5498e65a24a | |
parent | 72abb8c5d487ead9eb115fec8132ccef5ba189e5 (diff) | |
download | cpython-d5442851a6fad16ba32b62723c09e40a1392aa38.zip cpython-d5442851a6fad16ba32b62723c09e40a1392aa38.tar.gz cpython-d5442851a6fad16ba32b62723c09e40a1392aa38.tar.bz2 |
gh-112087: Remove duplicated critical_section (gh-114268)
-rw-r--r-- | Objects/listobject.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/Objects/listobject.c b/Objects/listobject.c index 79ef8f5..401d102 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -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] |