MCPcopy Create free account
hub / github.com/NanmiCoder/cc-haha / getPythonCandidates

Function getPythonCandidates

src/server/api/computer-use-python.ts:32–65  ·  view source on GitHub ↗
(platform: NodeJS.Platform)

Source from the content-addressed store, hash-verified

30}
31
32function getPythonCandidates(platform: NodeJS.Platform): PythonCandidate[] {
33 if (platform === 'win32') {
34 return [
35 {
36 command: 'python3',
37 prefixArgs: [],
38 locator: { command: 'where', args: ['python3'] },
39 },
40 {
41 command: 'python',
42 prefixArgs: [],
43 locator: { command: 'where', args: ['python'] },
44 },
45 {
46 command: 'py',
47 prefixArgs: ['-3'],
48 locator: { command: 'where', args: ['py'] },
49 },
50 {
51 command: 'py',
52 prefixArgs: [],
53 locator: { command: 'where', args: ['py'] },
54 },
55 ]
56 }
57
58 return [
59 {
60 command: 'python3',
61 prefixArgs: [],
62 locator: { command: 'which', args: ['python3'] },
63 },
64 ]
65}
66
67function extractPythonVersion(output: string): string | null {
68 const match = output.match(/Python\s+([0-9][^\s]*)/i)

Callers 1

detectPythonRuntimeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected