gh-96704 (PR #96756, 3.12) changed BaseEventLoop.call_exception_handler() to run the handler inside task.get_context() / handle.get_context(). The change was applied only to the branch where a custom handler is set with loop.set_exception_handler(). When no handler is set, default_exception_handler() is called directly, in whatever context is current at that moment.
Activity
pythongh-159303: Document the exception handler context change