Bug report
Bug description:
ENTER_EXECUTOR doesn't check if an executor is invalid. We currently get away with this because only instrumentation invalidates executors, and it cleans up the ENTER_EXECUTORs.
It would be safer if ENTER_EXECUTOR check for invalid executors, and it would reduce the coupling between executors and instrumentation.
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs