Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,15 @@ export class PythonShell extends EventEmitter {
let pythonOptions = toArray(options.pythonOptions);
let scriptArgs = toArray(options.args);

this.scriptPath = join(options.scriptPath || '', scriptPath);
this.scriptPath = scriptPath;
this.command = pythonOptions.concat(this.scriptPath, scriptArgs);
this.mode = options.mode || 'text';
this.formatter = resolve('format', options.formatter || this.mode);
this.parser = resolve('parse', options.parser || this.mode);
// We don't expect users to ever format stderr as JSON so we default to text mode
this.stderrParser = resolve('parse', options.stderrParser || 'text');
this.terminated = false;
options.cwd = options.scriptPath;
this.childProcess = spawn(pythonPath, this.command, options);

['stdout', 'stdin', 'stderr'].forEach(function (name) {
Expand Down