MCPcopy Create free account
hub / github.com/appium/appium / validatePythonVersion

Method validatePythonVersion

packages/docutils/lib/validate.ts:383–400  ·  view source on GitHub ↗

* Asserts that the Python version is 3.x

()

Source from the content-addressed store, hash-verified

381 * Asserts that the Python version is 3.x
382 */
383 protected async validatePythonVersion() {
384 log.debug(`Validating ${NAME_PYTHON} version`);
385
386 const pythonPath = this.pythonPath ?? (await findPython());
387 if (!pythonPath) {
388 return this.fail(MESSAGE_PYTHON_MISSING);
389 }
390
391 try {
392 const {stdout} = await exec(pythonPath, ['--version']);
393 if (!stdout.includes(PYTHON_VER_STR)) {
394 return this.fail(`Could not find Python 3.x in PATH; found ${stdout}`);
395 }
396 } catch {
397 return this.fail(`Could not retrieve Python version`);
398 }
399 this.ok('Python version OK');
400 }
401}

Callers 1

validateMethod · 0.95

Calls 3

failMethod · 0.95
okMethod · 0.95
debugMethod · 0.65

Tested by

no test coverage detected