Skip to content

Commit 0affe01

Browse files
author
Kartik Raj
authored
Do not use conda run when launching a debugger (#18858)
* Do not use conda run when launching a debugger * News * Only build VSIX * Revert "Only build VSIX" This reverts commit 0ade929.
1 parent c6e011a commit 0affe01

File tree

2 files changed

+2
-34
lines changed

2 files changed

+2
-34
lines changed

news/2 Fixes/18847.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix launch of Python Debugger when using conda environments.

src/client/debugger/extension/adapter/factory.ts

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ import { IApplicationShell } from '../../../common/application/types';
1616
import { EXTENSION_ROOT_DIR } from '../../../constants';
1717
import { IInterpreterService } from '../../../interpreter/contracts';
1818
import { traceLog, traceVerbose } from '../../../logging';
19-
import { Conda } from '../../../pythonEnvironments/common/environmentManagers/conda';
20-
import { EnvironmentType, PythonEnvironment } from '../../../pythonEnvironments/info';
19+
import { PythonEnvironment } from '../../../pythonEnvironments/info';
2120
import { sendTelemetryEvent } from '../../../telemetry';
2221
import { EventName } from '../../../telemetry/constants';
2322
import { AttachRequestArguments, LaunchRequestArguments } from '../../types';
@@ -143,40 +142,8 @@ export class DebugAdapterDescriptorFactory implements IDebugAdapterDescriptorFac
143142
return this.getExecutableCommand(interpreters[0]);
144143
}
145144

146-
private async getCondaCommand(): Promise<Conda | undefined> {
147-
const condaCommand = await Conda.getConda();
148-
const isCondaRunSupported = await condaCommand?.isCondaRunSupported();
149-
return isCondaRunSupported ? condaCommand : undefined;
150-
}
151-
152145
private async getExecutableCommand(interpreter: PythonEnvironment | undefined): Promise<string[]> {
153146
if (interpreter) {
154-
if (interpreter.envType === EnvironmentType.Conda) {
155-
const condaCommand = await this.getCondaCommand();
156-
if (condaCommand) {
157-
if (interpreter.envName) {
158-
return [
159-
condaCommand.command,
160-
'run',
161-
'-n',
162-
interpreter.envName,
163-
'--no-capture-output',
164-
'--live-stream',
165-
'python',
166-
];
167-
} else if (interpreter.envPath) {
168-
return [
169-
condaCommand.command,
170-
'run',
171-
'-p',
172-
interpreter.envPath,
173-
'--no-capture-output',
174-
'--live-stream',
175-
'python',
176-
];
177-
}
178-
}
179-
}
180147
return interpreter.path.length > 0 ? [interpreter.path] : [];
181148
}
182149
return [];

0 commit comments

Comments
 (0)