* Parse a Python version string like "Python 3.13.6" and return * { major, minor, patch, raw } or null on failure.
(raw)
| 75 | * { major, minor, patch, raw } or null on failure. |
| 76 | */ |
| 77 | function parsePythonVersion(raw) { |
| 78 | const m = raw.match(/Python\s+(\d+)\.(\d+)\.(\d+)/); |
| 79 | if (!m) return null; |
| 80 | return { |
| 81 | major: Number(m[1]), |
| 82 | minor: Number(m[2]), |
| 83 | patch: Number(m[3]), |
| 84 | raw: `${m[1]}.${m[2]}.${m[3]}`, |
| 85 | }; |
| 86 | } |
| 87 | |
| 88 | /** |
| 89 | * Try a single Python candidate. Returns { exe, version } or null. |
no outgoing calls
no test coverage detected