Mark Shannon <m...@hotpy.org> added the comment:

Why this occurs:

with cm: 
    A
    break

translates to something like:

ex = cm.__exit__; cm.__enter__()  # with cm
    A
    ex(...)
    goto loop_end   # break

So, the break is traced after the exit call.

However, this doesn't seem consistent with try-finally statements which trace 
any break/continue/return before the finally block.

----------
keywords: +3.10regression
nosy: +pablogsal
priority: normal -> release blocker
stage:  -> needs patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue44298>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to