Skip to content

Commit

Permalink
Missed a piece of feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
rchiodo committed Dec 3, 2023
1 parent bf17a2f commit 2862553
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* with a specified set of options.
*/

import { isPythonBinary } from '../analyzer/pythonPathUtils';
import { AnalyzerService, getNextServiceId } from '../analyzer/service';
import { CommandLineOptions } from '../common/commandLineOptions';
import { LogLevel } from '../common/console';
Expand Down Expand Up @@ -121,11 +122,13 @@ function getEffectiveCommandLineOptions(
commandLineOptions.venvPath = serverSettings.venvPath.getFilePath();
}

if (serverSettings.pythonPath && serverSettings.pythonPath.getRootPathLength() > 0) {
if (serverSettings.pythonPath) {
// The Python VS Code extension treats the value "python" specially. This means
// the local python interpreter should be used rather than interpreting the
// setting value as a path to the interpreter. We'll simply ignore it in this case.
commandLineOptions.pythonPath = serverSettings.pythonPath.getFilePath();
if (!isPythonBinary(serverSettings.pythonPath.getFilePath())) {
commandLineOptions.pythonPath = serverSettings.pythonPath.getFilePath();
}
}

if (serverSettings.typeshedPath) {
Expand Down

0 comments on commit 2862553

Please sign in to comment.