summaryrefslogtreecommitdiff
path: root/Python/peephole.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-11-14 01:21:00 +0100
committerVictor Stinner <victor.stinner@gmail.com>2013-11-14 01:21:00 +0100
commit6055df2a55bf5b38d13b1a9363c2d65116e8560e (patch)
tree8e4c0d58a209b74ba50a3f16b8c068ddaff0c6eb /Python/peephole.c
parentc30321c1e366a30afe4066a67cd60373f9de98cd (diff)
downloadcpython-6055df2a55bf5b38d13b1a9363c2d65116e8560e.tar.gz
Issue #19437: Fix fold_unaryops_on_constants() of the peephole optimizer, clear
the exception when PyList_Append() fails
Diffstat (limited to 'Python/peephole.c')
-rw-r--r--Python/peephole.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Python/peephole.c b/Python/peephole.c
index a49790a60f..4185462b34 100644
--- a/Python/peephole.c
+++ b/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);