def stop(self): if self.process: try: os.killpg(os.getpgid(self.process.pid), signal.SIGTERM) except OSError: pass