mirror of
https://github.com/python/cpython.git
synced 2025-08-23 02:04:56 +00:00
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.
This commit is contained in:
parent
f84d77b4e0
commit
766d2518ae
8 changed files with 231 additions and 44 deletions
|
@ -720,7 +720,11 @@ dummy_func(
|
|||
exc = args[0];
|
||||
/* fall through */
|
||||
case 0:
|
||||
ERROR_IF(do_raise(tstate, exc, cause), 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,
|
||||
|
@ -1047,6 +1051,7 @@ dummy_func(
|
|||
assert(exc && PyExceptionInstance_Check(exc));
|
||||
Py_INCREF(exc);
|
||||
_PyErr_SetRaisedException(tstate, exc);
|
||||
monitor_reraise(tstate, frame, next_instr-1);
|
||||
goto exception_unwind;
|
||||
}
|
||||
|
||||
|
@ -1058,6 +1063,7 @@ dummy_func(
|
|||
else {
|
||||
Py_INCREF(exc);
|
||||
_PyErr_SetRaisedException(tstate, exc);
|
||||
monitor_reraise(tstate, frame, next_instr-1);
|
||||
goto exception_unwind;
|
||||
}
|
||||
}
|
||||
|
@ -1072,6 +1078,7 @@ dummy_func(
|
|||
}
|
||||
else {
|
||||
_PyErr_SetRaisedException(tstate, Py_NewRef(exc_value));
|
||||
monitor_reraise(tstate, frame, next_instr-1);
|
||||
goto exception_unwind;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue