Skip to content

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

Merged
sobolevn merged 1 commit into
python:mainfrom
sobolevn:issue-133194-2
May 3, 2025
Merged

gh-133194: Fix regression with PEP 758 parsing on older feature_version#133289
sobolevn merged 1 commit into
python:mainfrom
sobolevn:issue-133194-2

Conversation

@sobolevn

@sobolevnsobolevn commented May 2, 2025

Copy link
Copy Markdown
Member

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

@cdce8pcdce8p left a comment

Copy link
Copy Markdown
Contributor

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

@lysnikolaoulysnikolaou left a comment

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.

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

@sobolevn

Copy link
Copy Markdown
MemberAuthor

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

Thanks everyone 👍

@sobolevn
sobolevn merged commit ca0a96d into python:mainMay 3, 2025
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