Skip to content

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

Closed
@sobolevn

Description

@sobolevn

Bug report

Right now this test passes:

    def test_pep758_except_without_parens(self):
        code = textwrap.dedent("""
            try:
                ...
            except ValueError, TypeError:
                ...
        """)
        ast.parse(code, feature_version=(3, 14))
        with self.assertRaises(SyntaxError):
            ast.parse(code, feature_version=(3, 13))

But, it should not pass. I have a PR ready.

Linked PRs

Metadata

Metadata

Assignees

Labels

3.14bugs and security fixestopic-parsertype-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions