diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2013-07-15 19:16:27 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2013-07-15 19:16:27 (GMT) |
commit | 7eab0d000cd12d76f90d4a80df1b728d3ff94728 (patch) | |
tree | 356f24116259d365aef312972cc4663f56a4f2e1 /Python | |
parent | a4ced86f0307d60c491261501f53a99cefcc33d2 (diff) | |
download | cpython-7eab0d000cd12d76f90d4a80df1b728d3ff94728.zip cpython-7eab0d000cd12d76f90d4a80df1b728d3ff94728.tar.gz cpython-7eab0d000cd12d76f90d4a80df1b728d3ff94728.tar.bz2 |
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')
-rw-r--r-- | Python/ceval.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index 61928e3..5a35524 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); |