Skip to content

Conversation

iritkatriel
Copy link
Member

@iritkatriel iritkatriel commented Nov 15, 2020

Pushes an artificial control "block" around the except part of a try-except.
This ensures that the computed depth in the compiler matches the actual depth in the runtime.
(cherry picked from commit 02d126a )

https://bugs.python.org/issue39934

@iritkatriel
Copy link
Member Author

I made this PR manually because there were significant merge conflicts. Please check I got it right.

Copy link
Member

@Fidget-Spinner Fidget-Spinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, though I think you need to change your title to [3.9] bpo-39934: Account for control blocks in 'except' in compiler. (GH-22395) . And the first message should be:

Pushes an artificial control "block" around the `except` part of a try-except.
This ensures that the computed depth in the compiler matches the actual depth in the runtime.
(cherry picked from commit 02d126aa09d96d03dcf9c5b51c858ce5ef386601 )

This will allow the bots to register it as a backport :). For more info, you can check the devguide section on backporting.

One potential concert may be that ADDOP_JREL was changed to ADDOP_JUMP in #21714. Although no behavior should have changed, I hope this doesn't cause problems in the future.

@iritkatriel iritkatriel changed the title bpo-39934: backport PR 22395 to 3.9 [3.9] bpo-39934: Account for control blocks in 'except' in compiler. (GH-22395) Nov 16, 2020
@bedevere-bot bedevere-bot added the type-bug An unexpected behavior, bug, or error label Nov 16, 2020
@markshannon
Copy link
Member

markshannon commented Nov 17, 2020

Thanks for doing this.
I wasn't going to bother with this because it's an obscure bug, it's fixed in 3.10 and I'm lazy 🙂

The changes look good to me.
I presume the NEWS item will need backporting as well.

@iritkatriel
Copy link
Member Author

I've added the news file.

I took this up to familiarize myself with the process. If you prefer to to backport we can just close this and the bpo issue. Up to you.

@markshannon
Copy link
Member

This is good. I don't need to do it myself.

@markshannon markshannon merged commit 48a9c0e into python:3.9 Nov 17, 2020
@iritkatriel iritkatriel deleted the 3.9 branch November 17, 2020 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants