From 052e308760b2381ae1f116ce547b073d22b711a0 Mon Sep 17 00:00:00 2001 From: Luca Mussi Date: Tue, 18 Oct 2016 13:47:46 +0200 Subject: [PATCH] use python.pythonPath to run sorting of imports --- src/client/providers/importSortProvider.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/client/providers/importSortProvider.ts b/src/client/providers/importSortProvider.ts index 9d396895c33b..bfa2762faea3 100644 --- a/src/client/providers/importSortProvider.ts +++ b/src/client/providers/importSortProvider.ts @@ -4,6 +4,7 @@ import * as vscode from "vscode"; import * as path from "path"; import * as fs from "fs"; import * as child_process from "child_process"; +import * as settings from '../common/configSettings'; import {getTextEditsFromPatch, getTempFileWithDocumentContents} from "../common/editor"; export class PythonImportSortProvider { @@ -20,7 +21,8 @@ export class PythonImportSortProvider { let tmpFileCreated = document.isDirty; let filePromise = tmpFileCreated ? getTempFileWithDocumentContents(document) : Promise.resolve(document.fileName); filePromise.then(filePath => { - child_process.exec(`python "${importScript}" "${filePath}" --diff`, (error, stdout, stderr) => { + const pythonPath = settings.PythonSettings.getInstance().pythonPath; + child_process.exec(`${pythonPath} "${importScript}" "${filePath}" --diff`, (error, stdout, stderr) => { if (tmpFileCreated) { fs.unlink(filePath); } @@ -35,4 +37,4 @@ export class PythonImportSortProvider { }).catch(reject); }); } -} \ No newline at end of file +}