mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
gh-131831: Implement PEP 758 – Allow except and except* expressions without parentheses (#131833)
This commit is contained in:
parent
053c285f6b
commit
c2ac662f28
7 changed files with 381 additions and 270 deletions
|
@ -1375,6 +1375,8 @@ class GrammarTests(unittest.TestCase):
|
|||
try: 1/0
|
||||
except (EOFError, TypeError, ZeroDivisionError): pass
|
||||
try: 1/0
|
||||
except EOFError, TypeError, ZeroDivisionError: pass
|
||||
try: 1/0
|
||||
except (EOFError, TypeError, ZeroDivisionError) as msg: pass
|
||||
try: pass
|
||||
finally: pass
|
||||
|
@ -1398,6 +1400,8 @@ class GrammarTests(unittest.TestCase):
|
|||
try: 1/0
|
||||
except* (EOFError, TypeError, ZeroDivisionError): pass
|
||||
try: 1/0
|
||||
except* EOFError, TypeError, ZeroDivisionError: pass
|
||||
try: 1/0
|
||||
except* (EOFError, TypeError, ZeroDivisionError) as msg: pass
|
||||
try: pass
|
||||
finally: pass
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue