Skip to content

Commit

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


def style_byte(b: int, color: bool = True) -> str:
Expand Down

0 comments on commit 13ff22c

Please sign in to comment.