Correct generator function parsing for 3.3..3.5

This commit is contained in:
rocky
2023-06-30 15:43:27 -04:00
parent 828b1c989d
commit 4b296e1ead
8 changed files with 44 additions and 28 deletions

View File

@@ -174,9 +174,11 @@ class ComprehensionMixin:
tree = tree[1]
pass
if tree in ("genexpr_func_async",):
if tree[3] == "comp_iter":
iter_index = 3
if tree in ("genexpr_func", "genexpr_func_async",):
for i in range(3, 5):
if tree[i] == "comp_iter":
iter_index = i
break
n = tree[iter_index]