KEMBAR78
gh-133194: Fix regression with PEP 758 parsing on older `feature_version` by sobolevn · Pull Request #133289 · python/cpython · GitHub
Skip to content

Conversation

@sobolevn
Copy link
Member

@sobolevn sobolevn commented May 2, 2025

My previous change was not quite correct in two ways:

  • minor: missing "are" in the exception message
  • major: it stopped allowing parsing valid code like except TypeError: with older feature_versions :(

I added a lot more tests and fixed the problem (hopefully)! Reviews are highly appreciated 🙏

Fixes #133195
Fixes #133194
cc @cdce8p

@sobolevn sobolevn changed the title gh-133192: Fix regression with PEP 758 parsing on older feature_version gh-133194: Fix regression with PEP 758 parsing on older feature_version May 2, 2025
Copy link
Contributor

@cdce8p cdce8p left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks @sobolevn for picking this up so quickly 🙏🏻

Copy link
Member

@lysnikolaou lysnikolaou left a comment

Choose a reason for hiding this comment

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

Yeah, this looks good to me! Missed it in the earlier PR. Surprised that the tests didn't catch it.

@sobolevn
Copy link
Member Author

sobolevn commented May 2, 2025

I will keep this open for a day, so maybe @pablogsal can also comment.

Thanks everyone 👍

@sobolevn sobolevn merged commit ca0a96d into python:main May 3, 2025
49 checks passed
Pranjal095 pushed a commit to Pranjal095/cpython that referenced this pull request Jul 12, 2025
…e_version` (python#133289)

pythongh-133192: Fix regression with PEP 758 parsing on older `feature_version`
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.

PEP 758 changes do not have CHECK_VERSION guard for usage with ast.parse(..., feature_version=(3, 13))

4 participants