def METHOD_NAME(self):
    if self.process is None:
        return
    if self.process_watcher is not None:
        self.process_watcher.METHOD_NAME()
        self.process_watcher = None
    def kill_process(stop_signal):
        if hasattr(os, 'getpgid') and hasattr(os, 'killpg'):
            os.killpg(os.getpgid(self.process.pid), stop_signal)
        else:
            os.kill(self.process.pid, self.stop_signal)
    try:
        kill_process(self.stop_signal)
    except OSError:
        # Process is already gone
        pass
    else:
        kill_time = time.time() + self.kill_after
        while time.time() < kill_time:
            if self.process.poll() is not None:
                break
            time.sleep(0.25)
        else:
            try:
                kill_process(9)
            except OSError:
                # Process is already gone
                pass
    self.process = None