Skip to content

Commit

Permalink
Removed overly strict error handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
djgroen committed Nov 15, 2024
1 parent 76997b1 commit 0c6f506
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions flee/moving.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,10 +521,10 @@ def selectRoute(a, time: int, debug: bool = False, return_all_routes: bool = Fal
route = chooseFromWeights(weights=weights, routes=routes)

if route == None:
print("ERROR: Empty route (None type) generated in selectRoute.", file=sys.stderr)
print(weights, routes, file=sys.stderr)
sys.exit()
if len(route) == 0:
print("WARNING: Empty route (None type) generated in selectRoute.", file=sys.stderr)
print(f"Location: {a.location.name}, {weights}, {routes}", file=sys.stderr)
#sys.exit()
elif len(route) == 0:
print(f"ERROR: Empty route {route} generated in selectRoute.", file=sys.stderr)
sys.exit()
#print("route chosen:", route)
Expand Down

0 comments on commit 0c6f506

Please sign in to comment.