Skip to content

Commit

Permalink
fixing check for SUMO_HOME in checkBinary
Browse files Browse the repository at this point in the history
  • Loading branch information
behrisch committed Nov 29, 2024
1 parent 35d7638 commit 60fef48
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tools/sumolib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,11 @@ def exe(binary):
return binary
try:
import sumo
binary = exe(os.path.join(sumo.SUMO_HOME, "bin", name))
if os.path.exists(binary):
return binary
# If there is a directory "sumo" in the current path, the import will succeed, so we need to double check.
if hasattr(sumo, "SUMO_HOME"):
binary = exe(os.path.join(sumo.SUMO_HOME, "bin", name))
if os.path.exists(binary):
return binary
except ImportError:
pass
if bindir is None:
Expand Down

0 comments on commit 60fef48

Please sign in to comment.