MCPcopy Create free account
hub / github.com/bleachbit/bleachbit / _resolve_executable

Function _resolve_executable

tests/TestWipePath.py:100–111  ·  view source on GitHub ↗

Return executable path if available, else None.

(path)

Source from the content-addressed store, hash-verified

98
99
100def _resolve_executable(path):
101 """Return executable path if available, else None."""
102 candidates = []
103 if os.path.isabs(path):
104 candidates.append(path)
105 candidates.append(shutil.which(os.path.basename(path)))
106 else:
107 candidates.append(shutil.which(path))
108 for candidate in candidates:
109 if candidate and os.path.exists(candidate) and os.access(candidate, os.X_OK):
110 return candidate
111 return None
112
113
114def format_filesystem(filename, fs_type):

Callers 2

_format_tool_availableFunction · 0.85
format_filesystemFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected