Commit 7eab0d00 authored by Victor Stinner's avatar Victor Stinner

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.
parent a4ced86f
...@@ -3090,7 +3090,10 @@ fast_block_end: ...@@ -3090,7 +3090,10 @@ fast_block_end:
Python main loop. */ Python main loop. */
PyErr_NormalizeException( PyErr_NormalizeException(
&exc, &val, &tb); &exc, &val, &tb);
PyException_SetTraceback(val, tb); if (tb != NULL)
PyException_SetTraceback(val, tb);
else
PyException_SetTraceback(val, Py_None);
Py_INCREF(exc); Py_INCREF(exc);
tstate->exc_type = exc; tstate->exc_type = exc;
Py_INCREF(val); Py_INCREF(val);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment