Check that python tools are installed.

This commit is contained in:
Andrew Hamilton 2020-04-11 22:55:19 +10:00
parent 24f8c576be
commit 69c957985a

View file

@ -680,6 +680,9 @@ def splitext(path):
@functools.lru_cache() @functools.lru_cache()
def is_tool_available(tool): def is_tool_available(tool):
if (hasattr(tool, "command") and
tool.command.startswith(f"{PYTHON_EXECUTABLE} -m ")):
return importlib.util.find_spec(tool.command.split()[2]) is not None
try: try:
return all(shutil.which(executable) for executable in tool.executables) return all(shutil.which(executable) for executable in tool.executables)
except AttributeError: except AttributeError: