◐ Shell
clean mode source ↗

gh-142186: all-local PEP-669 events by P403n1x87 · Pull Request #146182 · python/cpython

added 4 commits

March 19, 2026 12:03
We make the PY_UNWIND monitoring event available as a code-local
event to allow trapping on function exit events when an exception
bubbles up. This complements the PY_RETURN event by allowing to
catch any function exit event.
We make all the events of the low-impact monitoring API local,
shifting the distinction to whether they are instrumented or
non-instrumented.

@P403n1x87

P403n1x87

@P403n1x87 P403n1x87 marked this pull request as ready for review

March 23, 2026 11:36

@P403n1x87

@P403n1x87

@P403n1x87

@P403n1x87 P403n1x87 deleted the gh-142186-pep-669-all-local-events branch

April 22, 2026 08:57

scoder added a commit that referenced this pull request

Apr 25, 2026
…VENT_*` values from gh-146182 (gh-148955)

#146182 left an unintended change in the `PY_MONITORING_*` macro values. This change reverts that part to avoid a user visible impact.

ljfp pushed a commit to ljfp/cpython that referenced this pull request

Apr 25, 2026
…isableable (pythonGH-146182)

* Make the `PY_UNWIND` monitoring event available as a code-local
event to allow trapping on function exit events when an exception
bubbles up. This complements the PY_RETURN event by allowing to
catch any function exit event.

* Allow `PY_UNWIND`  to be `DISABLE`d; disabling it disables the event for the whole code object.

* Do the above for `PY_THROW`, `RAISE`, `EXCEPTION_HANDLED`, and `RERAISE` events.

ljfp pushed a commit to ljfp/cpython that referenced this pull request

Apr 25, 2026