Skip to content

Commit 7372367

Browse files
fnesvedaDonJayamanne
authored andcommitted
Resolve pythonPath before comparing it to shebang (#273)
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.
1 parent ca9b428 commit 7372367

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/client/interpreter/display/shebangCodeLensProvider.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ export class ShebangCodeLensProvider implements vscode.CodeLensProvider {
5353

5454
private async createShebangCodeLens(document: TextDocument) {
5555
const shebang = await ShebangCodeLensProvider.detectShebang(document);
56-
if (!shebang || shebang === settings.PythonSettings.getInstance(document.uri).pythonPath) {
56+
const pythonPath = settings.PythonSettings.getInstance(document.uri).pythonPath;
57+
const resolvedPythonPath = await ShebangCodeLensProvider.getFullyQualifiedPathToInterpreter(pythonPath);
58+
if (!shebang || shebang === resolvedPythonPath) {
5759
return [];
5860
}
5961

0 commit comments

Comments
 (0)