mirror of
https://github.com/home-assistant/core.git
synced 2026-05-20 23:40:15 +01:00
14 lines
277 B
Python
14 lines
277 B
Python
"""Util to handle processes."""
|
|
|
|
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
|