Skip to content

Commit d515d60

Browse files
jakebaileykarthiknadig
authored andcommitted
Fix Pylance Python 2 mistake (#16246)
1 parent 268f8e6 commit d515d60

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
@@ -245,9 +245,10 @@ export class LanguageServerExtensionActivationService
245245
}
246246
}
247247

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

0 commit comments

Comments
 (0)