Skip to content

ast.parse allows parenthesised context managers with old feature_version #94949

Closed
@hauntsaninja

Description

@hauntsaninja

The following should raise SyntaxError:

ast.parse('with (CtxManager() as example): ...', feature_version=(3, 9))

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions