mirror of https://github.com/python/cpython
Issue #19437: Fix fold_unaryops_on_constants() of the peephole optimizer, clear
the exception when PyList_Append() fails
This commit is contained in:
parent
507eabdf11
commit
c82729e44f
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue