diff options
author | Alex Waygood <Alex.Waygood@Gmail.com> | 2024-02-26 09:22:09 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-26 09:22:09 (GMT) |
commit | 7a3518e43aa50ea57fd35863da831052749b6115 (patch) | |
tree | bfd5cdecb5d3d71a74f2ec7f4fbf3981c0e2a20c /Grammar | |
parent | 8e8ab75d97f51c2850eb8cd711010662d5f1d360 (diff) | |
download | cpython-7a3518e43aa50ea57fd35863da831052749b6115.zip cpython-7a3518e43aa50ea57fd35863da831052749b6115.tar.gz cpython-7a3518e43aa50ea57fd35863da831052749b6115.tar.bz2 |
gh-115881: Ensure `ast.parse()` parses conditional context managers even with low `feature_version` passed (#115920)
Diffstat (limited to 'Grammar')
-rw-r--r-- | Grammar/python.gram | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Grammar/python.gram b/Grammar/python.gram index 174b4db..797c195 100644 --- a/Grammar/python.gram +++ b/Grammar/python.gram @@ -393,7 +393,7 @@ for_stmt[stmt_ty]: with_stmt[stmt_ty]: | invalid_with_stmt_indent | 'with' '(' a[asdl_withitem_seq*]=','.with_item+ ','? ')' ':' tc=[TYPE_COMMENT] b=block { - CHECK_VERSION(stmt_ty, 9, "Parenthesized context managers are", _PyAST_With(a, b, NEW_TYPE_COMMENT(p, tc), EXTRA)) } + _PyAST_With(a, b, NEW_TYPE_COMMENT(p, tc), EXTRA) } | 'with' a[asdl_withitem_seq*]=','.with_item+ ':' tc=[TYPE_COMMENT] b=block { _PyAST_With(a, b, NEW_TYPE_COMMENT(p, tc), EXTRA) } | 'async' 'with' '(' a[asdl_withitem_seq*]=','.with_item+ ','? ')' ':' b=block { |