Commit 095d99ff authored by Victor Stinner's avatar Victor Stinner

Issue #18408: Fix listpop(), handle list_ass_slice() failure

parent 479054bc
...@@ -934,12 +934,10 @@ listpop(PyListObject *self, PyObject *args) ...@@ -934,12 +934,10 @@ listpop(PyListObject *self, PyObject *args)
} }
Py_INCREF(v); Py_INCREF(v);
status = list_ass_slice(self, i, i+1, (PyObject *)NULL); status = list_ass_slice(self, i, i+1, (PyObject *)NULL);
assert(status >= 0); if (status < 0) {
/* Use status, so that in a release build compilers don't Py_DECREF(v);
* complain about the unused name. return NULL;
*/ }
(void) status;
return v; return v;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment