Correct 3.4 "yield from" semantic action bug

This commit is contained in:
rocky
2019-06-29 04:59:03 -04:00
parent e26c7407a0
commit 0dc19a8fdd
4 changed files with 6 additions and 3 deletions

View File

@@ -193,12 +193,12 @@ def customize_for_version3(self, version):
def n_yield_from(node):
self.write('yield from')
self.write(' ')
if 3.3 <= self.version <= 3.4:
if 3.3 == self.version:
self.preorder(node[0][0][0][0])
elif self.version >= 3.5:
elif self.version >= 3.4:
self.preorder(node[0])
else:
assert False, "dunno about this python version"
assert False, "dunno how ths Python handles 'yield from'"
self.prune() # stop recursing
self.n_yield_from = n_yield_from