Skip to content

Commit 51e1e69

Browse files
authored
Restore computing version in legacy locators (#23596)
Fixes #23580
1 parent 9d33853 commit 51e1e69

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/client/pythonEnvironments/base/locators/composite/resolverUtils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ async function resolveGloballyInstalledEnv(env: BasicEnvInfo): Promise<PythonEnv
147147
const { executablePath } = env;
148148
let version;
149149
try {
150-
version = env.version ?? parseVersionFromExecutable(executablePath);
150+
version = parseVersionFromExecutable(executablePath);
151151
} catch {
152152
version = UNKNOWN_PYTHON_VERSION;
153153
}
@@ -170,7 +170,7 @@ async function resolveSimpleEnv(env: BasicEnvInfo): Promise<PythonEnvInfo> {
170170
const { executablePath, kind } = env;
171171
const envInfo = buildEnvInfo({
172172
kind,
173-
version: env.version ?? (await getPythonVersionFromPath(executablePath)),
173+
version: await getPythonVersionFromPath(executablePath),
174174
executable: executablePath,
175175
sysPrefix: env.envPath,
176176
location: env.envPath,
@@ -243,7 +243,7 @@ async function resolveCondaEnv(env: BasicEnvInfo): Promise<PythonEnvInfo> {
243243
} else {
244244
executable = await conda.getInterpreterPathForEnvironment({ prefix: envPath });
245245
}
246-
const version = env.version ?? (executable ? await getPythonVersionFromPath(executable) : undefined);
246+
const version = executable ? await getPythonVersionFromPath(executable) : undefined;
247247
const info = buildEnvInfo({
248248
executable,
249249
kind: PythonEnvKind.Conda,

0 commit comments

Comments
 (0)