summaryrefslogtreecommitdiffstats
path: root/Grammar
diff options
context:
space:
mode:
authorNikita Sobolev <mail@sobolevn.me>2022-09-05 16:54:09 (GMT)
committerGitHub <noreply@github.com>2022-09-05 16:54:09 (GMT)
commit2c7d2e8d46164efb6e27a64081d8e949f6876515 (patch)
tree20cdb1ece49de9a14c731c62ab31dcab7929da09 /Grammar
parenta9d58feccfd956dc99195af6872b06446738d7db (diff)
downloadcpython-2c7d2e8d46164efb6e27a64081d8e949f6876515.zip
cpython-2c7d2e8d46164efb6e27a64081d8e949f6876515.tar.gz
cpython-2c7d2e8d46164efb6e27a64081d8e949f6876515.tar.bz2
gh-96587: Raise `SyntaxError` for PEP654 on older `feature_version` (#96588)
Diffstat (limited to 'Grammar')
-rw-r--r--Grammar/python.gram4
1 files changed, 3 insertions, 1 deletions
diff --git a/Grammar/python.gram b/Grammar/python.gram
index d4df78b..51f846a 100644
--- a/Grammar/python.gram
+++ b/Grammar/python.gram
@@ -412,7 +412,9 @@ try_stmt[stmt_ty]:
| invalid_try_stmt
| 'try' &&':' b=block f=finally_block { _PyAST_Try(b, NULL, NULL, f, EXTRA) }
| 'try' &&':' b=block ex[asdl_excepthandler_seq*]=except_block+ el=[else_block] f=[finally_block] { _PyAST_Try(b, ex, el, f, EXTRA) }
- | 'try' &&':' b=block ex[asdl_excepthandler_seq*]=except_star_block+ el=[else_block] f=[finally_block] { _PyAST_TryStar(b, ex, el, f, EXTRA) }
+ | 'try' &&':' b=block ex[asdl_excepthandler_seq*]=except_star_block+ el=[else_block] f=[finally_block] {
+ CHECK_VERSION(stmt_ty, 11, "Exception groups are",
+ _PyAST_TryStar(b, ex, el, f, EXTRA)) }
# Except statement