Skip to content

Commit

Permalink
Restore computing version in legacy locators (microsoft#23596)
Browse files Browse the repository at this point in the history
  • Loading branch information
karthiknadig authored and eleanorjboyd committed Jun 28, 2024
1 parent 50e44d3 commit f93c851
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ async function resolveGloballyInstalledEnv(env: BasicEnvInfo): Promise<PythonEnv
const { executablePath } = env;
let version;
try {
version = env.version ?? parseVersionFromExecutable(executablePath);
version = parseVersionFromExecutable(executablePath);
} catch {
version = UNKNOWN_PYTHON_VERSION;
}
Expand All @@ -170,7 +170,7 @@ async function resolveSimpleEnv(env: BasicEnvInfo): Promise<PythonEnvInfo> {
const { executablePath, kind } = env;
const envInfo = buildEnvInfo({
kind,
version: env.version ?? (await getPythonVersionFromPath(executablePath)),
version: await getPythonVersionFromPath(executablePath),
executable: executablePath,
sysPrefix: env.envPath,
location: env.envPath,
Expand Down Expand Up @@ -243,7 +243,7 @@ async function resolveCondaEnv(env: BasicEnvInfo): Promise<PythonEnvInfo> {
} else {
executable = await conda.getInterpreterPathForEnvironment({ prefix: envPath });
}
const version = env.version ?? (executable ? await getPythonVersionFromPath(executable) : undefined);
const version = executable ? await getPythonVersionFromPath(executable) : undefined;
const info = buildEnvInfo({
executable,
kind: PythonEnvKind.Conda,
Expand Down

0 comments on commit f93c851

Please sign in to comment.