()
| 36 | * so warm-path callers avoid repeated `which`/`where` subprocess spawns. |
| 37 | */ |
| 38 | export function resolvePythonExe(): string { |
| 39 | if (_resolvedPythonExe !== null) return _resolvedPythonExe; |
| 40 | if (binaryInPath('python3') !== null) return (_resolvedPythonExe = 'python3'); |
| 41 | if (binaryInPath('python') !== null) return (_resolvedPythonExe = 'python'); |
| 42 | return (_resolvedPythonExe = 'python3'); // conventional fallback — fails at spawn with a clear error |
| 43 | } |
| 44 | |
| 45 | /** Test-only: clear the memoized interpreter so platform-mocked tests re-resolve. */ |
| 46 | export function __resetResolvedPythonExe(): void { |
no test coverage detected