mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-19 19:15:43 +00:00
Fix SetupAsyncWith stack level handling
This commit is contained in:
parent
2b677d0124
commit
89c08246ba
2 changed files with 93 additions and 0 deletions
|
@ -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')
|
||||
"
|
||||
));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue