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

the exception when PyList_Append() fails
This commit is contained in:
Victor Stinner 2013-11-14 01:21:00 +01:00
parent 507eabdf11
commit c82729e44f
1 changed files with 1 additions and 0 deletions

View File

@ -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);