Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -448,11 +448,11 @@ export class PythonShell extends EventEmitter {

/**
* Sends a kill signal to the process
* @returns {PythonShell} The same instance for chaining calls
* @returns {boolean} Whether the kill signal was sent successfully
*/
kill(signal?: NodeJS.Signals) {
this.terminated = this.childProcess.kill(signal);
return this;
return this.terminated;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions test/test-python-shell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -617,9 +617,9 @@ describe('PythonShell', function () {
});

describe('.kill()', function () {
it('set terminated to correct value', function (done) {
it('return kill result and set terminated to correct value', function (done) {
let pyshell = new PythonShell('infinite_loop.py');
pyshell.kill();
should(pyshell.kill()).be.true();
pyshell.terminated.should.be.true;
done();
});
Expand Down