diff options
author | Pablo Galindo Salgado <Pablogsal@gmail.com> | 2025-04-01 20:04:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-01 19:04:56 +0000 |
commit | c2ac662f284b7c3f0701173f2467bf1e18aad2e2 (patch) | |
tree | 2ff5b9d81ebb22945875a183ac807fd77b6e82f7 /Lib/test/test_grammar.py | |
parent | 053c285f6b41f92fbdd1d4ff0c959cceefacd7cd (diff) | |
download | cpython-c2ac662f284b7c3f0701173f2467bf1e18aad2e2.tar.gz cpython-c2ac662f284b7c3f0701173f2467bf1e18aad2e2.zip |
gh-131831: Implement PEP 758 – Allow except and except* expressions without parentheses (#131833)
Diffstat (limited to 'Lib/test/test_grammar.py')
-rw-r--r-- | Lib/test/test_grammar.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_grammar.py b/Lib/test/test_grammar.py index 3f1e1fa51fd..3ea4e47ca50 100644 --- a/Lib/test/test_grammar.py +++ b/Lib/test/test_grammar.py @@ -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 |