Fix SetupAsyncWith stack level handling

This commit is contained in:
Noah 2021-02-17 17:11:39 -06:00
parent 2b677d0124
commit 89c08246ba
2 changed files with 93 additions and 0 deletions

View file

@ -2563,6 +2563,23 @@ if True and False and False:
"\
if (True and False) or (False and True):
pass
"
));
}
#[test]
fn test_nested_double_async_with() {
assert_dis_snapshot!(compile_exec(
"\
for stop_exc in (StopIteration('spam'), StopAsyncIteration('ham')):
with self.subTest(type=type(stop_exc)):
try:
async with woohoo():
raise stop_exc
except Exception as ex:
self.assertIs(ex, stop_exc)
else:
self.fail(f'{stop_exc} was suppressed')
"
));
}