Uh oh!
There was an error while loading. Please reload this page.
gh-105658: fix excess trace events for except block ending with a conditional block - #109384
Conversation
carljm
left a comment
There was a problem hiding this comment.
I don't see a test here that reflects the case in the filed bug, where the line number actually jumps back to a previous line in a conditional. I believe that this change would fix that, but would it make sense to add an explicit test for it?
Uh oh!
There was an error while loading. Please reload this page.
| (3, 'line'), | ||
| (3, 'exception'), | ||
| (5, 'line'), | ||
| (6, 'line'), |
There was a problem hiding this comment.
On main we have here another (5, 'line'),
miss-islington
commented
Sep 14, 2023
Thanks @iritkatriel for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12. |
miss-islington
commented
Sep 14, 2023
Sorry, @iritkatriel, I could not cleanly backport this to |
bedevere-bot
commented
Sep 14, 2023
|
bedevere-bot
commented
Sep 14, 2023
|
… a conditional block (python#109384) (cherry picked from commit 4a54074)
bedevere-bot
commented
Sep 14, 2023
|
bedevere-bot
commented
Sep 14, 2023
|
GH-109411 is a backport of this pull request to the 3.12 branch. |
bedevere-bot
commented
Sep 14, 2023
|
This will remove the event with the wrong line number. It will still work because RERAISE doesn't need to have a line number attached. In exception_unwind, the instruction pointer on the frame is used to determine which exception handler should be invoked. The location of the reraise doesn't show up in the traceback.
Fixes#105658.