mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
gh-94949: Disallow parsing parenthesised ctx mgr with old feature_version (#94950)
* gh-94949: Disallow parsing parenthesised ctx manager with old feature_version * 📜🤖 Added by blurb_it. * Allow it with feature_version=(3, 9) as well Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
This commit is contained in:
parent
73eab9f35c
commit
0daba82221
4 changed files with 11 additions and 2 deletions
|
@ -391,7 +391,7 @@ for_stmt[stmt_ty]:
|
|||
with_stmt[stmt_ty]:
|
||||
| invalid_with_stmt_indent
|
||||
| 'with' '(' a[asdl_withitem_seq*]=','.with_item+ ','? ')' ':' b=block {
|
||||
_PyAST_With(a, b, NULL, EXTRA) }
|
||||
CHECK_VERSION(stmt_ty, 9, "Parenthesized context managers are", _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