diff options
author | Irit Katriel <1055913+iritkatriel@users.noreply.github.com> | 2021-12-14 16:48:15 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-14 16:48:15 +0000 |
commit | d60457a6673cf0263213c2f2be02c633ec2e2038 (patch) | |
tree | 04461db9079cf30a98c5a4070098f795275aa910 /Lib/test/test_compile.py | |
parent | 850aefc2c651110a784cd5478af9774b1f6287a3 (diff) | |
download | cpython-git-d60457a6673cf0263213c2f2be02c633ec2e2038.tar.gz |
bpo-45292: [PEP-654] add except* (GH-29581)
Diffstat (limited to 'Lib/test/test_compile.py')
-rw-r--r-- | Lib/test/test_compile.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py index f4ed6c706d..5bd7b06530 100644 --- a/Lib/test/test_compile.py +++ b/Lib/test/test_compile.py @@ -1263,6 +1263,39 @@ class TestStackSizeStability(unittest.TestCase): """ self.check_stack_size(snippet) + def test_try_except_star_qualified(self): + snippet = """ + try: + a + except* ImportError: + b + else: + c + """ + self.check_stack_size(snippet) + + def test_try_except_star_as(self): + snippet = """ + try: + a + except* ImportError as e: + b + else: + c + """ + self.check_stack_size(snippet) + + def test_try_except_star_finally(self): + snippet = """ + try: + a + except* A: + b + finally: + c + """ + self.check_stack_size(snippet) + def test_try_finally(self): snippet = """ try: |