Skip to content

Commit 8e99110

Browse files
committed
why complain about exact same code that was previously there
1 parent 4c55602 commit 8e99110

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/client/common/terminal/service.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ export class TerminalService implements ITerminalService, Disposable {
104104
}
105105
const config = getConfiguration('python');
106106
const pythonrcSetting = config.get<boolean>('terminal.shellIntegration.enabled');
107-
// const pythonVersion = 'await this.getPythonVersion()';
108-
// const isPython313 = pythonVersion?.startsWith('3.13');
107+
const pythonVersion = await this.getPythonVersion();
108+
const isPython313 = pythonVersion?.startsWith('3.13');
109109

110110
if (isPythonShell && (!pythonrcSetting || isWindows())) {
111111
// If user has explicitly disabled SI for Python, use sendText for inside Terminal REPL.
@@ -183,16 +183,16 @@ export class TerminalService implements ITerminalService, Disposable {
183183
});
184184
}
185185

186-
// private async getPythonVersion(): Promise<string | undefined> {
187-
// const pythonPath = this.serviceContainer
188-
// .get<IConfigurationService>(IConfigurationService)
189-
// .getSettings(this.options?.resource).pythonPath;
190-
// const interpreterInfo =
191-
// this.options?.interpreter ||
192-
// (await this.serviceContainer
193-
// .get<IInterpreterService>(IInterpreterService)
194-
// .getInterpreterDetails(pythonPath));
195-
// const pythonVersion = interpreterInfo && interpreterInfo.version ? interpreterInfo.version.raw : undefined;
196-
// return pythonVersion;
197-
// }
186+
private async getPythonVersion(): Promise<string | undefined> {
187+
const pythonPath = this.serviceContainer
188+
.get<IConfigurationService>(IConfigurationService)
189+
.getSettings(this.options?.resource).pythonPath;
190+
const interpreterInfo =
191+
this.options?.interpreter ||
192+
(await this.serviceContainer
193+
.get<IInterpreterService>(IInterpreterService)
194+
.getInterpreterDetails(pythonPath));
195+
const pythonVersion = interpreterInfo && interpreterInfo.version ? interpreterInfo.version.raw : undefined;
196+
return pythonVersion;
197+
}
198198
}

0 commit comments

Comments
 (0)