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-42908: Mark cleanup code at end of try-except and with artificial #24202

Merged

Conversation

markshannon
Copy link
Member

@markshannon markshannon commented Jan 12, 2021

This PR:

  • Marks the cleanup code at end of try-except and with as artificial
  • Keeps the CFG normalized by eliminating empty blocks between passes.
  • Does a better job of propagating line numbers across of blocks, to ensure that exits have line numbers.

No NEWS as this is tidying up loose ends of the PEP 626 implementation.

https://bugs.python.org/issue42908

@markshannon markshannon reopened this Jan 12, 2021
@markshannon markshannon merged commit 3bd6035 into python:master Jan 13, 2021
3 checks passed
@bedevere-bot
Copy link

bedevere-bot commented Jan 13, 2021

@markshannon: Please replace # with GH- in the commit message next time. Thanks!

@markshannon markshannon deleted the make-jumps-at-end-try-except-artificial branch Jan 13, 2021
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 13, 2021
…python#24202)

* Mark bytecodes at end of try-except as artificial.

* Make sure that the CFG is consistent throughout optimiization. 

* Extend line-number propagation logic so that implicit returns after 'try-except' or 'with' have the correct line numbers.

* Update importlib
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants