This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Mark.Shannon
Recipients Mark.Shannon, nedbat, pablogsal
Date 2021-06-03.12:18:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1622722734.09.0.990917553939.issue44298@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2021-06-03 12:18:54Mark.Shannonsetrecipients: + Mark.Shannon, nedbat, pablogsal
2021-06-03 12:18:54Mark.Shannonsetmessageid: <1622722734.09.0.990917553939.issue44298@roundup.psfhosted.org>
2021-06-03 12:18:54Mark.Shannonlinkissue44298 messages
2021-06-03 12:18:53Mark.Shannoncreate