Skip to content

Commit

Permalink
Issue python#19437: Fix fold_unaryops_on_constants() of the peephole …
Browse files Browse the repository at this point in the history
…optimizer, clear

the exception when PyList_Append() fails
  • Loading branch information
vstinner committed Nov 14, 2013
1 parent 507eabd commit c82729e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Python/peephole.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c82729e

Please sign in to comment.