Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e17752d

Browse files
committed
fix bad merge
1 parent cf88e7c commit e17752d

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

‎index.ts‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,12 +249,17 @@ export class PythonShell extends EventEmitter{
249249
})
250250
}
251251

252+
static getPythonPath(){
253+
return this.defaultOptions.pythonPath ? this.defaultOptions.pythonPath : this.defaultPythonPath;
254+
}
255+
252256
/**
253257
* checks syntax without executing code
254258
* @returns {Promise} rejects w/ stderr if syntax failure
255259
*/
256260
static async checkSyntaxFile(filePath:string){
257-
let compileCommand = `${this.defaultPythonPath} -m py_compile ${filePath}`
261+
const pythonPath = this.getPythonPath()
262+
let compileCommand = `${pythonPath} -m py_compile ${filePath}`
258263
return execPromise(compileCommand)
259264
}
260265

@@ -294,12 +299,12 @@ export class PythonShell extends EventEmitter{
294299
};
295300

296301
static getVersion(pythonPath?:string){
297-
if(!pythonPath) pythonPath = this.defaultPythonPath
302+
if(!pythonPath) pythonPath = this.getPythonPath()
298303
return execPromise(pythonPath + " --version");
299304
}
300305

301306
static getVersionSync(pythonPath?:string){
302-
if(!pythonPath) pythonPath = this.defaultPythonPath
307+
if(!pythonPath) pythonPath = this.getPythonPath()
303308
return execSync(pythonPath + " --version").toString()
304309
}
305310

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /