gh-131831: Implement PEP 758 – Allow except and except* expressions without parentheses (#131833)

This commit is contained in:
Pablo Galindo Salgado 2025-04-01 20:04:56 +01:00 committed by GitHub
parent 053c285f6b
commit c2ac662f28
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 381 additions and 270 deletions

View file

@ -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