[Python-checkins] cpython: Issue #18408: Fix PyEval_EvalFrameEx() for MemoryError

victor.stinner python-checkins at python.org
Tue Jul 16 00:12:55 CEST 2013


http://hg.python.org/cpython/rev/71a572a516f9
changeset:   84646:71a572a516f9
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Mon Jul 15 21:16:27 2013 +0200
summary:
  Issue #18408: Fix PyEval_EvalFrameEx() for MemoryError

Don't pass a NULL traceback to PyException_SetTraceback(): pass Py_None.
Passing NULL would raise a new exception.

files:
  Python/ceval.c |  5 ++++-
  1 files changed, 4 insertions(+), 1 deletions(-)


diff --git a/Python/ceval.c b/Python/ceval.c
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -3090,7 +3090,10 @@
                    Python main loop. */
                 PyErr_NormalizeException(
                     &exc, &val, &tb);
-                PyException_SetTraceback(val, tb);
+                if (tb != NULL)
+                    PyException_SetTraceback(val, tb);
+                else
+                    PyException_SetTraceback(val, Py_None);
                 Py_INCREF(exc);
                 tstate->exc_type = exc;
                 Py_INCREF(val);

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


More information about the Python-checkins mailing list