Skip to content

Return result from kill() #255

Open

Description

Is your feature request related to a problem? Please describe.
Using the kill() method has no feedback. The childProcess.kill() method which python-shell uses internally returns a boolean describing the success of the operation, but it's not used. In fact it seems that python-shell assumes it was successfully killed as it sets terminated = true regardless of what happens.

Describe the solution you'd like
Return a boolean for success or failure of killing

Activity

  1. Almenon commented on Oct 2, 2021

    @Almenon
    Collaborator

    The kill() method() method already has a return value - it returns this allowing you to chain methods.

    Although now that I think about it method chaining in this case is not really useful 🤔. If you kill the process you're probably done calling pythonshell methods.

    So feel free to submit a PR changing this behavior if you wish and I'll review it.

  2. luke-waymark-addinsight commented on Oct 4, 2021

    @luke-waymark-addinsight
    ContributorAuthor

    Perhaps rather than setting this.terminated = true blindly, it could instead do this.terminated = this.childProcess.kill(sig), that way you could check the returned object if it successfully terminated and perhaps try again with a more aggressive kill signal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions