Skip to content

Commit

Permalink
Apply review suggestion
Browse files Browse the repository at this point in the history
Co-authored-by: Grazfather <[email protected]>
  • Loading branch information
mkrasnitski and Grazfather authored Oct 28, 2024
1 parent f053502 commit a00d9f1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions gef.py
Original file line number Diff line number Diff line change
Expand Up @@ -1936,10 +1936,9 @@ def gef_pybytes(x: str) -> bytes:
@lru_cache()
def which(program: str) -> pathlib.Path:
"""Locate a command on the filesystem."""
path = shutil.which(program)
if path:
return pathlib.Path(path)
else:
try:
return pathlib.Path(shutil.which(program))
except TypeError:
raise FileNotFoundError(f"Missing file `{program}`")


Expand Down

0 comments on commit a00d9f1

Please sign in to comment.