Skip to content

Commit

Permalink
try adding .exe suffix on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
martclanor committed Dec 27, 2024
1 parent b351659 commit 910ab3b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions flopy/mbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,11 @@ def _resolve(exe_name):
): # mode=0 effectively allows which() to find exe without suffix in windows
return exe

# try removing .exe suffix
if exe_name.lower().endswith(".exe"):
# try adding/removing .exe suffix
if on_windows and exe_name.lower().endswith(".exe"):
return _resolve(exe_name[:-4])
elif on_windows and "." not in Path(exe_name).stem:
return _resolve(f"{exe_name}.exe")

exe_path = _resolve(exe_name)

Expand Down

0 comments on commit 910ab3b

Please sign in to comment.