Skip to content

Commit 11045c1

Browse files
committed
check taskkill return code on Windows to detect failures
1 parent 18a7945 commit 11045c1

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

concore_cli/commands/stop.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,11 @@ def stop_all(console):
5656
name = proc.info.get('name', 'unknown')
5757

5858
if sys.platform == 'win32':
59-
subprocess.run(['taskkill', '/F', '/PID', str(pid)],
60-
capture_output=True,
61-
check=False)
59+
result = subprocess.run(['taskkill', '/F', '/PID', str(pid)],
60+
capture_output=True,
61+
check=False)
62+
if result.returncode != 0:
63+
raise RuntimeError(f"taskkill failed with code {result.returncode}")
6264
else:
6365
proc.terminate()
6466
proc.wait(timeout=3)

0 commit comments

Comments
 (0)