gh-120225: fix crash in compiler on empty block at end of exception handler (#120235)

This commit is contained in:
Irit Katriel 2024-06-07 22:37:35 +01:00 committed by GitHub
parent e6076d1e13
commit 4fc82b6d3b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 13 additions and 6 deletions

View file

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