mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
[3.12] gh-115881: Ensure ast.parse()
parses conditional context managers even with low feature_version
passed (#115920) (#115959)
This commit is contained in:
parent
1932da0c3d
commit
53b84e772c
4 changed files with 10 additions and 10 deletions
|
@ -392,7 +392,7 @@ for_stmt[stmt_ty]:
|
|||
with_stmt[stmt_ty]:
|
||||
| invalid_with_stmt_indent
|
||||
| 'with' '(' a[asdl_withitem_seq*]=','.with_item+ ','? ')' ':' b=block {
|
||||
CHECK_VERSION(stmt_ty, 9, "Parenthesized context managers are", _PyAST_With(a, b, NULL, EXTRA)) }
|
||||
_PyAST_With(a, b, NULL, 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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue