[Python-checkins] cpython: Issue #19437: Fix fold_unaryops_on_constants() of the peephole optimizer, clear

victor.stinner python-checkins at python.org
Thu Nov 14 01:47:12 CET 2013


http://hg.python.org/cpython/rev/eea54395797c
changeset:   87090:eea54395797c
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Thu Nov 14 01:21:00 2013 +0100
summary:
  Issue #19437: Fix fold_unaryops_on_constants() of the peephole optimizer, clear
the exception when PyList_Append() fails

files:
  Python/peephole.c |  1 +
  1 files changed, 1 insertions(+), 0 deletions(-)


diff --git a/Python/peephole.c b/Python/peephole.c
--- a/Python/peephole.c
+++ b/Python/peephole.c
@@ -275,6 +275,7 @@
     len_consts = PyList_GET_SIZE(consts);
     if (PyList_Append(consts, newconst)) {
         Py_DECREF(newconst);
+        PyErr_Clear();
         return 0;
     }
     Py_DECREF(newconst);

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list