From: Victor Stinner Date: Thu, 14 Nov 2013 00:21:00 +0000 (+0100) Subject: Issue #19437: Fix fold_unaryops_on_constants() of the peephole optimizer, clear X-Git-Tag: v3.4.0b1~285^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c82729e44f2935f72b5cd0e7eb36a87558459663;p=thirdparty%2FPython%2Fcpython.git Issue #19437: Fix fold_unaryops_on_constants() of the peephole optimizer, clear the exception when PyList_Append() fails --- diff --git a/Python/peephole.c b/Python/peephole.c index a49790a60f89..4185462b34af 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);