FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-98442: fix locations of with statement's cleanup instructions by iritkatriel · Pull Request #120763 · python/cpython · GitHub

/ cpython Public

gh-98442: fix locations of with statement's cleanup instructions - #120763

Merged
iritkatriel merged 1 commit into
python:mainfrom
iritkatriel:gh-98442
Jun 20, 2024
Merged

gh-98442: fix locations of with statement's cleanup instructions#120763
iritkatriel merged 1 commit into
python:mainfrom
iritkatriel:gh-98442

Conversation

iritkatriel commented Jun 19, 2024
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Member

Comment thread Lib/test/test_compile.py

# Expect three load None instructions for the no-exception __exit__ call,
# and one RETURN_VALUE.
# They should all have the locations of the context manager ('xyz').

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Why doesn't the RETURN_VALUE have the location of the return statement?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The calculation of the value has that location. The return itself occurs after the exit, so it gets the location of the exit (the last instruction executed before the return).

iritkatriel merged commit 55596ae into python:main Jun 20, 2024

Copy link
Copy Markdown

Thanks @iritkatriel for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 20, 2024
pythonGH-120763)

(cherry picked from commit 55596ae)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
pythongh-98442: fix location of with statement's cleanup instructions

bedevere-app Bot commented Jun 20, 2024

Copy link
Copy Markdown

GH-120786 is a backport of this pull request to the 3.13 branch.

bedevere-app Bot removed the needs backport to 3.13 bugs and security fixes label Jun 20, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 20, 2024
pythonGH-120763)

(cherry picked from commit 55596ae)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
pythongh-98442: fix location of with statement's cleanup instructions

bedevere-app Bot commented Jun 20, 2024

Copy link
Copy Markdown

GH-120787 is a backport of this pull request to the 3.12 branch.

bedevere-app Bot removed the needs backport to 3.12 only security fixes label Jun 20, 2024
mrahtz pushed a commit to mrahtz/cpython that referenced this pull request Jun 30, 2024
noahbkim pushed a commit to hudson-trading/cpython that referenced this pull request Jul 11, 2024
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
iritkatriel added a commit that referenced this pull request Sep 2, 2024
…ns (GH-120763) (#120786)

gh-98442: fix locations of with statement's cleanup instructions (GH-120763)
(cherry picked from commit 55596ae)


gh-98442: fix location of with statement's cleanup instructions

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
iritkatriel added a commit that referenced this pull request Sep 15, 2024
…ns (GH-120763) (#120787)

gh-98442: fix locations of with statement's cleanup instructions (GH-120763)
(cherry picked from commit 55596ae)


gh-98442: fix location of with statement's cleanup instructions

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Source location of return instruction in a with block is incorrect

2 participants


Back | FazBrowse Home | New Git URL