Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-37830: Fix compilation of break and continue in finally. #15320

Merged

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Aug 17, 2019

Fix compilation of "break" and "continue" in the "finally" block when the corresponding "try" block contains "return" with a non-constant value.

https://bugs.python.org/issue37830

Fix compilation of "break" and "continue" in the
"finally" block when the corresponding "try" block
contains "return" with a non-constant value.
Lib/test/test_grammar.py Outdated Show resolved Hide resolved
Copy link
Contributor

@ncoghlan ncoghlan left a comment

Choose a reason for hiding this comment

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

I'd still like to revert to disallowing continue in finally blocks, but fixing the segfault is important.

@serhiy-storchaka serhiy-storchaka merged commit ef61c52 into python:master Aug 24, 2019
@serhiy-storchaka serhiy-storchaka deleted the jump-from-finally-after-return branch August 24, 2019 10:11
@miss-islington
Copy link
Contributor

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Sorry @serhiy-storchaka, I had trouble checking out the 3.8 backport branch.
Please backport using cherry_picker on command line.
cherry_picker ef61c524ddeeb56da3858b86e349e7288d68178e 3.8

serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Aug 24, 2019
…ythonGH-15320)

Fix compilation of "break" and "continue" in the
"finally" block when the corresponding "try" block
contains "return" with a non-constant value..
(cherry picked from commit ef61c52)

Co-authored-by: Serhiy Storchaka <[email protected]>
@bedevere-bot
Copy link

GH-15456 is a backport of this pull request to the 3.8 branch.

serhiy-storchaka added a commit that referenced this pull request Aug 24, 2019
…H-15320) (GH-15456)

Fix compilation of "break" and "continue" in the
"finally" block when the corresponding "try" block
contains "return" with a non-constant value.
(cherry picked from commit ef61c52)
lisroach pushed a commit to lisroach/cpython that referenced this pull request Sep 10, 2019
…H-15320)

Fix compilation of "break" and "continue" in the
"finally" block when the corresponding "try" block
contains "return" with a non-constant value.
DinoV pushed a commit to DinoV/cpython that referenced this pull request Jan 14, 2020
…H-15320)

Fix compilation of "break" and "continue" in the
"finally" block when the corresponding "try" block
contains "return" with a non-constant value.
websurfer5 pushed a commit to websurfer5/cpython that referenced this pull request Jul 20, 2020
…H-15320)

Fix compilation of "break" and "continue" in the
"finally" block when the corresponding "try" block
contains "return" with a non-constant value.
@serhiy-storchaka serhiy-storchaka removed their assignment Dec 29, 2020
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.

6 participants