diff options
author | 2022-07-18 02:20:12 -0700 | |
---|---|---|
committer | 2022-07-18 10:20:12 +0100 | |
commit | ae0be5a53bb4caee3de4888341addd9c94133f2d (patch) | |
tree | b6dbf5b251e3ef14eeb30da142e14fa22dbebb60 /Grammar | |
parent | gh-94847: Don't force inlining in debug builds of libmpdec (GH-94848) (diff) | |
download | cpython-ae0be5a53bb4caee3de4888341addd9c94133f2d.tar.gz cpython-ae0be5a53bb4caee3de4888341addd9c94133f2d.tar.bz2 cpython-ae0be5a53bb4caee3de4888341addd9c94133f2d.zip |
gh-94947: Disallow parsing walrus with feature_version < (3, 8) (#94948)
* gh-94947: Disallow parsing walrus with feature_version < (3, 8)
* oops, commit the parser
* 📜🤖 Added by blurb_it.
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Diffstat (limited to 'Grammar')
-rw-r--r-- | Grammar/python.gram | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Grammar/python.gram b/Grammar/python.gram index 91d73a9fffd..6a8bb942fff 100644 --- a/Grammar/python.gram +++ b/Grammar/python.gram @@ -660,7 +660,9 @@ star_named_expression[expr_ty]: | named_expression assignment_expression[expr_ty]: - | a=NAME ':=' ~ b=expression { _PyAST_NamedExpr(CHECK(expr_ty, _PyPegen_set_expr_context(p, a, Store)), b, EXTRA) } + | a=NAME ':=' ~ b=expression { + CHECK_VERSION(expr_ty, 8, "Assignment expressions are", + _PyAST_NamedExpr(CHECK(expr_ty, _PyPegen_set_expr_context(p, a, Store)), b, EXTRA)) } named_expression[expr_ty]: | assignment_expression |