From 239d19bd2f492071783e22ed3483c30e52107188 Mon Sep 17 00:00:00 2001 From: rsm31 Date: Wed, 23 Dec 2020 17:59:00 +0000 Subject: [PATCH] Make Python/PySys detection more reliable: - Check for empty interpeter_path config as well as the default value - Check for version information of the form "Python x.y.z" --- src/extension.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/extension.ts b/src/extension.ts index 338ee02..5dfb94f 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -61,7 +61,7 @@ async function getPysysInterpreter(logger: vscode.OutputChannel): Promise= 0) { + if( versionOutput.stdout.indexOf("ersion") >= 0 || versionOutput.stdout.indexOf("ython") >= 0) { version = versionOutput.stdout.match(/([.-9])+/g)[0]; - } else if (versionOutput.stderr.indexOf("ersion") >= 0) { + } else if (versionOutput.stderr.indexOf("ersion") >= 0 || versionOutput.stdout.indexOf("ython") >= 0) { version = versionOutput.stderr.match(/([.-9])+/g)[0]; }