From 910ab3b086bad3aa4064f902d7b5270d86d9583a Mon Sep 17 00:00:00 2001 From: martclanor Date: Fri, 27 Dec 2024 19:22:51 +0100 Subject: [PATCH] try adding .exe suffix on windows --- flopy/mbase.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/flopy/mbase.py b/flopy/mbase.py index 99e32bf1f..1d541e128 100644 --- a/flopy/mbase.py +++ b/flopy/mbase.py @@ -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)