diff options
author | Mark Shannon <mark@hotpy.org> | 2023-07-27 12:32:30 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-27 12:32:30 (GMT) |
commit | 766d2518ae8384c6bd7f82727defeb86847ccf64 (patch) | |
tree | 1831ee92ae897c8236517ede9e860ab26656df3f /Python/generated_cases.c.h | |
parent | f84d77b4e07aeb6241c1ff9932627d3ba059efa8 (diff) | |
download | cpython-766d2518ae8384c6bd7f82727defeb86847ccf64.zip cpython-766d2518ae8384c6bd7f82727defeb86847ccf64.tar.gz cpython-766d2518ae8384c6bd7f82727defeb86847ccf64.tar.bz2 |
GH-106897: Add `RERAISE` event to `sys.monitoring`. (GH-107291)
* Ensures that exception handling events are balanced. Each [re]raise event has a matching unwind/handled event.
Diffstat (limited to 'Python/generated_cases.c.h')
-rw-r--r-- | Python/generated_cases.c.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h index 02ad69a..37ffb56 100644 --- a/Python/generated_cases.c.h +++ b/Python/generated_cases.c.h @@ -881,7 +881,11 @@ exc = args[0]; /* fall through */ case 0: - if (do_raise(tstate, exc, cause)) { STACK_SHRINK(oparg); goto exception_unwind; } + if (do_raise(tstate, exc, cause)) { + assert(oparg == 0); + monitor_reraise(tstate, frame, next_instr-1); + goto exception_unwind; + } break; default: _PyErr_SetString(tstate, PyExc_SystemError, @@ -1237,6 +1241,7 @@ assert(exc && PyExceptionInstance_Check(exc)); Py_INCREF(exc); _PyErr_SetRaisedException(tstate, exc); + monitor_reraise(tstate, frame, next_instr-1); goto exception_unwind; } @@ -1251,6 +1256,7 @@ else { Py_INCREF(exc); _PyErr_SetRaisedException(tstate, exc); + monitor_reraise(tstate, frame, next_instr-1); goto exception_unwind; } STACK_SHRINK(2); @@ -1274,6 +1280,7 @@ } else { _PyErr_SetRaisedException(tstate, Py_NewRef(exc_value)); + monitor_reraise(tstate, frame, next_instr-1); goto exception_unwind; } STACK_SHRINK(1); |