Files
project-work/home-assistant/homeassistant/util/process.py
2026-11-19 15:15:32 -05:00

16 lines
313 B
Python

"""Util to handle processes."""
from __future__ import annotations
import subprocess
from typing import Any
def kill_subprocess(process: subprocess.Popen[Any]) -> None:
"""Force kill a subprocess and wait for it to exit."""
process.kill()
process.communicate()
process.wait()
del process