diff --git a/choreographer/utils/_kill.py b/choreographer/utils/_kill.py index d7e43442..4c29b1f5 100644 --- a/choreographer/utils/_kill.py +++ b/choreographer/utils/_kill.py @@ -7,7 +7,7 @@ def kill(process: subprocess.Popen[bytes]) -> None: if platform.system() == "Windows": subprocess.call( # noqa: S603, false positive, input fine - ["taskkill", "/F", "/T", "/PID", str(process.pid)], # noqa: S607 windows full path... + ["taskkill", "/IM", "/F", "/T", "/PID", str(process.pid)], # noqa: S607 windows full path... stderr=subprocess.DEVNULL, stdout=subprocess.DEVNULL, ) diff --git a/tests/test_process.py b/tests/test_process.py index b32733c0..bc2b65dd 100644 --- a/tests/test_process.py +++ b/tests/test_process.py @@ -77,7 +77,7 @@ async def test_watchdog(headless): if platform.system() == "Windows": # Blocking process here because it ensures the kill will occur rn subprocess.call( # noqa: S603, ASYNC221 sanitize input, blocking process - ["taskkill", "/F", "/T", "/PID", str(browser.subprocess.pid)], # noqa: S607 + ["taskkill", "/IM", "/F", "/T", "/PID", str(browser.subprocess.pid)], # noqa: S607 stderr=subprocess.DEVNULL, stdout=subprocess.DEVNULL, )