mirror of
https://github.com/python/cpython.git
synced 2025-10-07 15:42:02 +00:00
[3.11] gh-96587: Raise SyntaxError
for PEP654 on older feature_version
(GH-96588) (#96591)
(cherry picked from commit 2c7d2e8d46
)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
This commit is contained in:
parent
a8d50aeada
commit
8c6ced36ab
4 changed files with 15 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue