diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2013-11-14 01:21:00 +0100 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2013-11-14 01:21:00 +0100 |
commit | 6055df2a55bf5b38d13b1a9363c2d65116e8560e (patch) | |
tree | 8e4c0d58a209b74ba50a3f16b8c068ddaff0c6eb /Python/peephole.c | |
parent | c30321c1e366a30afe4066a67cd60373f9de98cd (diff) | |
download | cpython-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.c | 1 |
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); |