From f2b45889a8e23ffb5873f4572fa2ce91526dcfb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Nesveda?= Date: Tue, 21 Nov 2017 17:10:43 +0100 Subject: [PATCH] Resolve pythonPath before comparing it to shebang When comparing if the path to the Python interpreter from the shebang in a file and the pythonPath setting point to one and the same interpreter, resolve pythonPath to the path to the actual Python interpreter executable before the comparison. --- src/client/interpreter/display/shebangCodeLensProvider.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/client/interpreter/display/shebangCodeLensProvider.ts b/src/client/interpreter/display/shebangCodeLensProvider.ts index d1a43cc70baa..c7cd0e19534e 100644 --- a/src/client/interpreter/display/shebangCodeLensProvider.ts +++ b/src/client/interpreter/display/shebangCodeLensProvider.ts @@ -53,7 +53,9 @@ export class ShebangCodeLensProvider implements vscode.CodeLensProvider { private async createShebangCodeLens(document: TextDocument) { const shebang = await ShebangCodeLensProvider.detectShebang(document); - if (!shebang || shebang === settings.PythonSettings.getInstance(document.uri).pythonPath) { + const pythonPath = settings.PythonSettings.getInstance(document.uri).pythonPath; + const resolvedPythonPath = await ShebangCodeLensProvider.getFullyQualifiedPathToInterpreter(pythonPath); + if (!shebang || shebang === resolvedPythonPath) { return []; }