Skip to content

Commit 5d64454

Browse files
author
richbalmer
committed
Honour defaultOptions.pythonPath in checkSyntax
1 parent da77217 commit 5d64454

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,12 @@ export class PythonShell extends EventEmitter{
244244
*/
245245
static async checkSyntaxFile(filePath:string){
246246

247-
let compileCommand = `${this.defaultPythonPath} -m py_compile ${filePath}`
247+
let pythonPath:string;
248+
if (this.defaultOptions.pythonPath) {
249+
pythonPath = this.defaultOptions.pythonPath;
250+
} else pythonPath = this.defaultPythonPath;
251+
252+
let compileCommand = `${pythonPath} -m py_compile ${filePath}`
248253

249254
return new Promise<string>((resolve, reject) => {
250255
exec(compileCommand, (error, stdout, stderr) => {

0 commit comments

Comments
 (0)