Commit c82729e4 authored by Victor Stinner's avatar Victor Stinner

Issue #19437: Fix fold_unaryops_on_constants() of the peephole optimizer, clear

the exception when PyList_Append() fails
parent 507eabdf
......@@ -275,6 +275,7 @@ fold_unaryops_on_constants(unsigned char *codestr, PyObject *consts, PyObject *v
len_consts = PyList_GET_SIZE(consts);
if (PyList_Append(consts, newconst)) {
Py_DECREF(newconst);
PyErr_Clear();
return 0;
}
Py_DECREF(newconst);
......
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