Skip to content

Commit 766d251

Browse files
authored
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.
1 parent f84d77b commit 766d251

File tree

8 files changed

+231
-44
lines changed

8 files changed

+231
-44
lines changed

Include/cpython/code.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ extern "C" {
1010

1111

1212
/* Count of all "real" monitoring events (not derived from other events) */
13-
#define _PY_MONITORING_UNGROUPED_EVENTS 14
13+
#define _PY_MONITORING_UNGROUPED_EVENTS 15
1414
/* Count of all monitoring events */
15-
#define _PY_MONITORING_EVENTS 16
15+
#define _PY_MONITORING_EVENTS 17
1616

1717
/* Table of which tools are active for each monitored event. */
1818
typedef struct _Py_Monitors {

Include/internal/pycore_instruments.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,13 @@ extern "C" {
3636
#define PY_MONITORING_EVENT_EXCEPTION_HANDLED 11
3737
#define PY_MONITORING_EVENT_PY_UNWIND 12
3838
#define PY_MONITORING_EVENT_PY_THROW 13
39+
#define PY_MONITORING_EVENT_RERAISE 14
3940

4041

4142
/* Ancilliary events */
4243

43-
#define PY_MONITORING_EVENT_C_RETURN 14
44-
#define PY_MONITORING_EVENT_C_RAISE 15
44+
#define PY_MONITORING_EVENT_C_RETURN 15
45+
#define PY_MONITORING_EVENT_C_RAISE 16
4546

4647

4748
typedef uint32_t _PyMonitoringEventSet;

0 commit comments

Comments
 (0)