'Kill the process. If group=True, all sub-processes will also be killed.'

def kill(self, group=True):

    self.kill_called = True
    if mswindows:
        if (group and self._job):
            winprocess.TerminateJobObject(self._job, 127)
        else:
            try:
                winprocess.TerminateProcess(self._handle, 127)
            except:
                pass
        self.returncode = 127
    else:
        if group:
            try:
                os.killpg(self.pid, signal.SIGKILL)
            except:
                pass
        else:
            os.kill(self.pid, signal.SIGKILL)
        super(Popen, self).kill()
        self.returncode = (-9)
