1
0
mirror of https://github.com/home-assistant/core.git synced 2025-05-04 22:19:17 +00:00
2022-01-11 13:33:25 -08: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