Skip to content
Snippets Groups Projects
Commit e2d3abe8 authored by Chris Lamb's avatar Chris Lamb :eyes:
Browse files

Try some alternative suffixes (eg. ".py") to support distributions that strip...

Try some alternative suffixes (eg. ".py") to support distributions that strip or retain them. (Closes: #283)
parent d2ac5465
No related branches found
No related tags found
No related merge requests found
Pipeline #307111 failed
......@@ -45,12 +45,18 @@ OS_NAMES = collections.OrderedDict(
def find_executable(cmd):
"""
Given a command name (eg. `dumppdf`), return the absolute path to that
command.
command. Will also try the command with some common suffixes (eg.
`dumppdf.py`) to support distributions that strip or retain them.
Returns an empy string (``) if no command is found.
"""
return shutil.which(f"{cmd}{suffix}")
for suffix in ("", ".py"):
val = shutil.which(f"{cmd}{suffix}")
if val:
return val
return ""
def get_tools(only_missing=False):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment