[issue44298] 3.10.0b2 traces with-exit before the break that caused the exit

2021-06-03 Thread Ned Batchelder
Ned Batchelder added the comment: Thanks for the quick turnaround, this works! -- ___ Python tracker ___ ___ Python-bugs-list

[issue44298] 3.10.0b2 traces with-exit before the break that caused the exit

2021-06-03 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Ned, can you confirm that this works for you? I am closing the issue, but if something is missing, please, reopen it and we will look into it :) -- resolution: -> fixed stage: patch review -> resolved status: open -> closed

[issue44298] 3.10.0b2 traces with-exit before the break that caused the exit

2021-06-03 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset cea0585b7939b487d7089f9d473f495264e8a491 by Mark Shannon in branch '3.10': [3.10] bpo-44298: Backport #26513 to 3.10 (#26516) https://github.com/python/cpython/commit/cea0585b7939b487d7089f9d473f495264e8a491 --

[issue44298] 3.10.0b2 traces with-exit before the break that caused the exit

2021-06-03 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +25111 pull_request: https://github.com/python/cpython/pull/26516 ___ Python tracker ___

[issue44298] 3.10.0b2 traces with-exit before the break that caused the exit

2021-06-03 Thread Mark Shannon
Mark Shannon added the comment: New changeset 937cebc93b4922583218e0cbf0a9a14705a595b2 by Mark Shannon in branch 'main': bpo-44298: Fix line numbers for early exits in with statements. (GH-26513) https://github.com/python/cpython/commit/937cebc93b4922583218e0cbf0a9a14705a595b2 --

[issue44298] 3.10.0b2 traces with-exit before the break that caused the exit

2021-06-03 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +25109 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/26513 ___ Python tracker

[issue44298] 3.10.0b2 traces with-exit before the break that caused the exit

2021-06-03 Thread Mark Shannon
Mark Shannon 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

[issue44298] 3.10.0b2 traces with-exit before the break that caused the exit

2021-06-03 Thread Mark Shannon
Mark Shannon added the comment: For context, this behavior was introduced in https://bugs.python.org/issue43933 -- ___ Python tracker ___

[issue44298] 3.10.0b2 traces with-exit before the break that caused the exit

2021-06-03 Thread Ned Batchelder
Ned Batchelder added the comment: (I'm not sure whether to create other issues for further details) I'm also seeing a return in a with will trace withexit/return for a plain "return" statement, but return/withexit/return for a return with a value ("return 17"). I would expect that a

[issue44298] 3.10.0b2 traces with-exit before the break that caused the exit

2021-06-03 Thread Ned Batchelder
New submission from Ned Batchelder : Python 3.10 now traces back to with statements when exiting the with block. When the exit is a break statement, the with exit is visited before the break statement is. This seems confusing. --- 8< - import