Skip to content

Commit d5b1184

Browse files
committed
fix default interpreter bug
1 parent c5189f1 commit d5b1184

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

src/helpers.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { ExtensionContext, extensions, QuickInputButtons, Uri, window, workspace } from 'vscode';
22
import { PythonEnvironment, PythonEnvironmentApi } from './api';
33
import { traceError, traceInfo, traceWarn } from './common/logging';
4-
import { normalizePath } from './common/utils/pathUtils';
54
import { isWindows } from './common/utils/platformUtils';
65
import { createTerminal, showInputBoxWithButtons } from './common/window.apis';
76
import { getConfiguration } from './common/workspace.apis';
@@ -271,10 +270,6 @@ export async function resolveDefaultInterpreter(
271270
try {
272271
const resolved: NativeEnvInfo = await nativeFinder.resolve(userSetdefaultInterpreter);
273272
if (resolved && resolved.executable) {
274-
if (normalizePath(resolved.executable) === normalizePath(userSetdefaultInterpreter)) {
275-
// no action required, the path is already correct
276-
return;
277-
}
278273
const resolvedEnv = await api.resolveEnvironment(Uri.file(resolved.executable));
279274
traceInfo(`[resolveDefaultInterpreter] API resolved environment: ${JSON.stringify(resolvedEnv)}`);
280275

@@ -294,7 +289,7 @@ export async function resolveDefaultInterpreter(
294289
version: resolved.version ?? '',
295290
displayPath: userSetdefaultInterpreter ?? '',
296291
environmentPath: userSetdefaultInterpreter ? Uri.file(userSetdefaultInterpreter) : Uri.file(''),
297-
sysPrefix: resolved.arch ?? '',
292+
sysPrefix: resolved.prefix ?? '',
298293
execInfo: {
299294
run: {
300295
executable: userSetdefaultInterpreter ?? '',

0 commit comments

Comments
 (0)