3.4 dictionary comprehension bug

Sync up fragment code with recent changesa
This commit is contained in:
rocky
2016-06-19 00:49:22 -04:00
parent 73df5f3737
commit d7b79c2b59
7 changed files with 36 additions and 13 deletions

View File

@@ -1053,7 +1053,7 @@ class SourceWalker(GenericASTTraversal, object):
def n_setcomp(self, node):
self.write('{')
if node[0] == 'LOAD_SETCOMP':
if node[0] in ['LOAD_SETCOMP', 'LOAD_DICTCOMP']:
self.listcomprehension_walk3(node, 1, 0)
else:
self.comprehension_walk(node, iter_index=4)
@@ -1078,7 +1078,7 @@ class SourceWalker(GenericASTTraversal, object):
# skip over stmts sstmt smt
ast = ast[0][0][0]
designator = None
if ast == 'setcomp_func':
if ast in ['setcomp_func', 'dictcomp_func']:
for k in ast:
if k == 'comp_iter':
n = k