From c82729e44f2935f72b5cd0e7eb36a87558459663 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 14 Nov 2013 01:21:00 +0100 Subject: [PATCH] Issue #19437: Fix fold_unaryops_on_constants() of the peephole optimizer, clear the exception when PyList_Append() fails --- Python/peephole.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Python/peephole.c b/Python/peephole.c index a49790a60f8..4185462b34a 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);