Handle nested async for in for...

and Better async comprehension detection.

Still more work is needed. See commented-out section in
test/simple_source/bug37/02_async_for_generator.py
This commit is contained in:
rocky
2020-03-31 12:05:39 -04:00
parent af8add9df4
commit e2d349f781
6 changed files with 130 additions and 52 deletions

View File

@@ -1207,7 +1207,11 @@ class SourceWalker(GenericASTTraversal, object):
is_30_dict_comp = False
store = None
n = ast[iter_index]
if node == "list_comp_async":
n = ast[2][1]
else:
n = ast[iter_index]
if ast in (
"set_comp_func",
"dict_comp_func",
@@ -1238,7 +1242,7 @@ class SourceWalker(GenericASTTraversal, object):
pass
pass
elif ast == "listcomp_async":
store = ast[3]
store = ast[2][1]
else:
assert n == "list_iter", n