def METHOD_NAME(self):
    if self.tpm.poll() is not None:
        return
    self.tpm.terminate()
    try:
        self.tpm.wait(timeout=1)
    except subprocess.TimeoutExpired:
        self.tpm.kill()
    self.tpm.wait(timeout=10)