Skip to content

Commit 2167c88

Browse files
author
whitequark
committedJun 6, 2015
algorithm.{Visitor,Transformer}: don't die on lists of strings.
1 parent a21205a commit 2167c88

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

Diff for: ‎pythonparser/algorithm.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def visit(self, obj):
3737
"""Visit a node or a list of nodes. Other values are ignored"""
3838
if isinstance(obj, list):
3939
for elt in obj:
40-
self._visit_one(elt)
40+
self.visit(elt)
4141
elif isinstance(obj, ast.AST):
4242
self._visit_one(obj)
4343

@@ -79,7 +79,7 @@ def _visit_one(self, node):
7979
def visit(self, obj):
8080
"""Visit a node or a list of nodes. Other values are ignored"""
8181
if isinstance(obj, list):
82-
return list(filter(lambda x: x is not None, map(self._visit_one, obj)))
82+
return list(filter(lambda x: x is not None, map(self.visit, obj)))
8383
elif isinstance(obj, ast.AST):
8484
return self._visit_one(obj)
8585

0 commit comments

Comments
 (0)
Please sign in to comment.