Skip to content

Commit ca3adb3

Browse files
authored
fix(resolve_exe): typecast exe name to string before passing to _resolve (#2457)
This PR aims to address #2455. The issue is related to an edge case wherein a missing executable that is being passed to resolve_exe is provided as a pathlib.Path object.
1 parent f6e69e9 commit ca3adb3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

flopy/mbase.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def _resolve(exe_name, checked=set()):
7171
checked.add(exe_name)
7272

7373
# exe_name is found (not None), ensure absolute path is returned
74-
if exe := which(str(exe_name)):
74+
if exe := which(exe_name):
7575
return which(str(Path(exe).resolve()))
7676

7777
# exe_name is relative path
@@ -88,7 +88,7 @@ def _resolve(exe_name, checked=set()):
8888
elif on_windows and "." not in Path(exe_name).stem:
8989
return _resolve(f"{exe_name}.exe", checked)
9090

91-
exe_path = _resolve(exe_name)
91+
exe_path = _resolve(str(exe_name))
9292

9393
# raise if we are unforgiving, otherwise return None
9494
if exe_path is None:

0 commit comments

Comments
 (0)