Skip to content

Commit 6878880

Browse files
authored
Fix Pylance Python 2 mistake (#16246)
1 parent 488d103 commit 6878880

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/client/activation/activationService.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,10 @@ export class LanguageServerExtensionActivationService
250250
}
251251
}
252252

253-
// If "Pylance" was explicitly chosen, use it even though it's not guaranteed to work
254-
// properly with Python 2.
255-
if (!this.getCurrentLanguageServerTypeIsDefault()) {
253+
// If Pylance was chosen via the default and the interpreter is Python 2, fall back to
254+
// Jedi. If Pylance was explicitly chosen, continue anyway, even if Pylance won't work
255+
// as expected, matching pre-default behavior.
256+
if (this.getCurrentLanguageServerTypeIsDefault()) {
256257
if (serverType === LanguageServerType.Node && interpreter && interpreter.version) {
257258
if (interpreter.version.major < 3) {
258259
sendTelemetryEvent(EventName.JEDI_FALLBACK);

0 commit comments

Comments
 (0)