Skip to content

Commit

Permalink
Fix for an error that can occur when pruning finds nowhere to go
Browse files Browse the repository at this point in the history
  • Loading branch information
kfsone committed Apr 5, 2015
1 parent 26d8e43 commit 6bf07b7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions commands/run_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -1071,6 +1071,11 @@ def routeStillHasAChance(r):

preCrop = len(routes)
routes[:] = [x for x in routes if routeStillHasAChance(x)]
if not routes:
raise NoDataError(
"No routes are in-range of any end stations at the end of hop {}"
.format(hopNo)
)
pruned = preCrop - len(routes)
if pruned:
cmdenv.NOTE("Pruned {} origins too far from any end stations", pruned)
Expand Down

0 comments on commit 6bf07b7

Please sign in to comment.