Skip to content

Conversation

@sobolevn
Copy link
Member

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

@sobolevnsobolevn changed the title gh-133192: Fix regression with PEP 758 parsing on older feature_versiongh-133194: Fix regression with PEP 758 parsing on older feature_versionMay 2, 2025
Copy link
Contributor

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

@lysnikolaoulysnikolaou 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
MemberAuthor

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

Thanks everyone 👍

@sobolevnsobolevn merged commit ca0a96d into python:mainMay 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 freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

@sobolevn@lysnikolaou@cdce8p@Eclips4