Skip to content

Commit

Permalink
PR: walk does not return a value (#578)
Browse files Browse the repository at this point in the history
* Second try: walk should not ever return a value
  • Loading branch information
edreamleo committed Dec 6, 2022
1 parent 129d761 commit 74a937d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rope/base/ast.py
Expand Up @@ -22,12 +22,13 @@ def parse(source, filename="<string>"):
raise error


def walk(node, walker):
def walk(node, walker) -> None:
"""Walk the syntax tree"""
method_name = "_" + node.__class__.__name__
method = getattr(walker, method_name, None)
if method is not None:
return method(node)
method(node)
return
for child in get_child_nodes(node):
walk(child, walker)

Expand Down

0 comments on commit 74a937d

Please sign in to comment.