Skip to content

gh-133194: Fix regression with PEP 758 parsing on older feature_version #133289

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

Merged
merged 1 commit into from
May 3, 2025

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
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