Skip to content

Commit 39a493e

Browse files
committed
fix(routing.py::find_path): if the starting ID == the end ID, return the end ID (which is the last ID in any other returned path), instead of raising an error.
1 parent 4339462 commit 39a493e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

sfrmaker/routing.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ def find_path(graph, start, end='0', limit=None):
122122
if limit is None:
123123
limit = len(graph)
124124
path = [start]
125+
if str(start) == str(end):
126+
return path
125127
next_id = start
126128
for i in range(limit):
127129
next_id = graph[next_id]

0 commit comments

Comments
 (0)