Skip to content

Commit

Permalink
fix(resolve_exe): typecast exe name to string before passing to _reso…
Browse files Browse the repository at this point in the history
…lve (#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.
  • Loading branch information
martclanor authored Feb 20, 2025
1 parent f6e69e9 commit ca3adb3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions flopy/mbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def _resolve(exe_name, checked=set()):
checked.add(exe_name)

# exe_name is found (not None), ensure absolute path is returned
if exe := which(str(exe_name)):
if exe := which(exe_name):
return which(str(Path(exe).resolve()))

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

exe_path = _resolve(exe_name)
exe_path = _resolve(str(exe_name))

# raise if we are unforgiving, otherwise return None
if exe_path is None:
Expand Down

0 comments on commit ca3adb3

Please sign in to comment.