mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
bpo-45292: [PEP-654] add except* (GH-29581)
This commit is contained in:
parent
850aefc2c6
commit
d60457a667
34 changed files with 7070 additions and 3332 deletions
|
@ -93,6 +93,19 @@ finally:
|
|||
suite5
|
||||
"""
|
||||
|
||||
try_except_star_finally = """\
|
||||
try:
|
||||
suite1
|
||||
except* ex1:
|
||||
suite2
|
||||
except* ex2:
|
||||
suite3
|
||||
else:
|
||||
suite4
|
||||
finally:
|
||||
suite5
|
||||
"""
|
||||
|
||||
with_simple = """\
|
||||
with f():
|
||||
suite1
|
||||
|
@ -304,6 +317,9 @@ class UnparseTestCase(ASTTestCase):
|
|||
def test_try_except_finally(self):
|
||||
self.check_ast_roundtrip(try_except_finally)
|
||||
|
||||
def test_try_except_star_finally(self):
|
||||
self.check_ast_roundtrip(try_except_star_finally)
|
||||
|
||||
def test_starred_assignment(self):
|
||||
self.check_ast_roundtrip("a, *b, c = seq")
|
||||
self.check_ast_roundtrip("a, (*b, c) = seq")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue