Skip to content

Commit 9621d28

Browse files
committed
fix stack trace not appearing in binary mode
1 parent 20dbdfa commit 9621d28

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,13 @@ export class PythonShell extends EventEmitter{
151151

152152
// listen to stderr and emit errors for incoming data
153153
if (this.stderrParser && this.stderr) {
154-
this.stderr.on('data', function (data) {
155-
errorData += ''+data;
156-
self.receiveStderr(data);
157-
});
154+
this.stderr.on('data', this.receiveStderr.bind(this));
158155
}
159156

160157
if (this.stderr) {
158+
this.stderr.on('data', function (data) {
159+
errorData += '' + data;
160+
});
161161
this.stderr.on('end', function(){
162162
self.stderrHasEnded = true;
163163
terminateIfNeeded();

0 commit comments

Comments
 (0)