def get_full_path_of_executable(name): full_path = os.path.abspath(name) while os.path.islink(full_path): full_path = os.path.realpath(full_path) if os.path.isfile(full_path) and os.access(full_path, os.X_OK): return full_path return get_full_path_of_executable(find_exe(name))
def try_find_exe(*args): try: return find_exe(*args) except: LOG.v(f"{args[0]} not found.") return ""