Mercurial > cpython-lru_cache-weakref
diff Python/ceval.c @ 84646:71a572a516f9
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.
| author | Victor Stinner <victor.stinner@gmail.com> |
|---|---|
| date | Mon, 15 Jul 2013 21:16:27 +0200 |
| parents | c3f9292c8efe |
| children | 92a9ccb2a521 |
line wrap: on
line diff
--- a/Python/ceval.c Mon Jul 15 20:00:36 2013 +0200 +++ b/Python/ceval.c Mon Jul 15 21:16:27 2013 +0200 @@ -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);
