summaryrefslogtreecommitdiff
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-07-15 21:16:27 +0200
committerVictor Stinner <victor.stinner@gmail.com>2013-07-15 21:16:27 +0200
commit549b0ef3ee5549644eda077e4eb083563de0b9ee (patch)
tree02dff1568cadf666bdf8f595964d3f63c7248b61 /Python/ceval.c
parentc8d1dc711ae91596f616f6ca794b4d3b0827db01 (diff)
downloadcpython-549b0ef3ee5549644eda077e4eb083563de0b9ee.tar.gz
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.
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 61928e39fe..5a35524a24 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -3090,7 +3090,10 @@ fast_block_end:
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);