diff --git a/swh/graph/graph.py b/swh/graph/graph.py --- a/swh/graph/graph.py +++ b/swh/graph/graph.py @@ -74,20 +74,22 @@ lambda: self.graph.java_graph.indegree(self.id), ) - def simple_traversal(self, ttype, direction="forward", edges="*"): + def simple_traversal(self, ttype, direction="forward", edges="*", max_edges=0): for node in call_async_gen( - self.graph.backend.simple_traversal, ttype, direction, edges, self.id + self.graph.backend.simple_traversal, + ttype, + direction, + edges, + self.id, + max_edges, ): yield self.graph[node] def leaves(self, *args, **kwargs): yield from self.simple_traversal("leaves", *args, **kwargs) - def visit_nodes(self, direction="forward", edges="*", max_edges=0): - for node in call_async_gen( - self.graph.backend.visit_nodes, direction, edges, self.id, max_edges - ): - yield self.graph[node] + def visit_nodes(self, *args, **kwargs): + yield from self.simple_traversal("visit_nodes", *args, **kwargs) def visit_edges(self, direction="forward", edges="*", max_edges=0): for src, dst in call_async_gen(