# Bug report ### Checklist - [X] I am confident this is a bug in CPython, not a bug in a third-party project - [X] I have searched the [CPython issue tracker](https://github.com/python/cpython/issues?q=is%3Aissue+sort%3Acreated-desc), and am confident this bug has not been reported before ### CPython versions tested on: 3.12 ### Operating systems tested on: _No response_ ### Output from running 'python -VV' on the command line: _No response_ ### A clear and concise description of the bug: `sys.monitoring.set_local_events(TOOL, code, sys.monitoring.events.RAISE)` should raise an exception, but succeeds. This was discovered when investigating https://github.com/python/cpython/issues/108390. Fixed by https://github.com/python/cpython/pull/108420