mirror of https://github.com/python/cpython
Issue #18408: ceval.c: in debug mode, convert the PyErr_Occurred() check on
exception (when getting NULL) to an assertion to detect bugs earlier
This commit is contained in:
parent
c31df04234
commit
365b693adc
|
@ -3026,9 +3026,13 @@ error:
|
|||
why = WHY_EXCEPTION;
|
||||
|
||||
/* Double-check exception status. */
|
||||
#ifdef NDEBUG
|
||||
if (!PyErr_Occurred())
|
||||
PyErr_SetString(PyExc_SystemError,
|
||||
"error return without exception set");
|
||||
#else
|
||||
assert(PyErr_Occurred());
|
||||
#endif
|
||||
|
||||
/* Log traceback info. */
|
||||
PyTraceBack_Here(f);
|
||||
|
|
Loading…
Reference in New Issue