Return executable path if available, else None.
(path)
| 98 | |
| 99 | |
| 100 | def _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 | |
| 114 | def format_filesystem(filename, fs_type): |
no outgoing calls
no test coverage detected