MCPcopy Create free account
hub / github.com/KnockOutEZ/wigolo / resolvePythonExe

Function resolvePythonExe

src/python-env.ts:38–43  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

36 * so warm-path callers avoid repeated `which`/`where` subprocess spawns.
37 */
38export 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. */
46export function __resetResolvedPythonExe(): void {

Callers 5

checkVenvModuleFunction · 0.85
checkPythonFunction · 0.85
checkPythonAvailableFunction · 0.85
bootstrapNativeSearxngFunction · 0.85

Calls 1

binaryInPathFunction · 0.85

Tested by

no test coverage detected