Bug report
Bug description:
# pyre-ignore-all-errors
def foo():
try:
[x for x in abc]
except OSError:
pass
return
import dis
dis.dis(foo)
When this code gets compiled a NOT_TAKEN instruction gets inserted after the exception handler pass has run and no except handler block is added to it. But it re-uses an instruction that got NOP'd out and previously had an instruction handler associated with it. The end result is that the NOT_TAKEN has a rather random exception handler block associated with it.
CPython versions tested on:
3.14, CPython main branch
Operating systems tested on:
Linux
Linked PRs