Browse Source

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

the exception when PyList_Append() fails
Victor Stinner 12 years ago
parent
commit
c82729e44f
  1. 1
      Python/peephole.c

1
Python/peephole.c

@ -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…
Cancel
Save