diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2013-11-14 00:21:00 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2013-11-14 00:21:00 (GMT) |
commit | c82729e44f2935f72b5cd0e7eb36a87558459663 (patch) | |
tree | be8e3f4dca4081604edb65d522f2c7e450ddb251 /Python/peephole.c | |
parent | 507eabdf11d34cd95cbe44ba876af0a414d7f597 (diff) | |
download | cpython-c82729e44f2935f72b5cd0e7eb36a87558459663.zip cpython-c82729e44f2935f72b5cd0e7eb36a87558459663.tar.gz cpython-c82729e44f2935f72b5cd0e7eb36a87558459663.tar.bz2 |
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 a49790a..4185462 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); |