diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2024-06-07 22:01:20 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-07 22:01:20 (GMT) |
commit | 3be7e91d037059dd98c175f48620191b538b9731 (patch) | |
tree | 7f9c1b19235cab66fd6b9424209ff5a30ff85993 /Lib | |
parent | 6238174e47a046dd6feb09ef4dd1bb55605ea0ad (diff) | |
download | cpython-3be7e91d037059dd98c175f48620191b538b9731.zip cpython-3be7e91d037059dd98c175f48620191b538b9731.tar.gz cpython-3be7e91d037059dd98c175f48620191b538b9731.tar.bz2 |
[3.13] gh-120225: fix crash in compiler on empty block at end of exception handler (GH-120235) (#120249)
gh-120225: fix crash in compiler on empty block at end of exception handler (GH-120235)
(cherry picked from commit 4fc82b6d3b99f873179937215833e7a573ca7876)
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_compile.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py index 1f4368b..410cdce 100644 --- a/Lib/test/test_compile.py +++ b/Lib/test/test_compile.py @@ -1409,6 +1409,16 @@ class TestSpecifics(unittest.TestCase): for kw in ("except", "except*"): exec(code % kw, g, l); + def test_regression_gh_120225(self): + async def name_4(): + match b'': + case True: + pass + case name_5 if f'e': + {name_3: name_4 async for name_2 in name_5} + case []: + pass + [[]] @requires_debug_ranges() class TestSourcePositions(unittest.TestCase): |