def METHOD_NAME(self):
    if self.returncode is None:
        try:
            os.kill(self.pid, signal.SIGTERM)
        except ProcessLookupError:
            pass
        except OSError:
            if self.wait(timeout=0.1) is None:
                raise