Skip to content

Commit ba586d1

Browse files
author
Bernat Zaragoza Travieso
committed
Fix SIGKILL not available in Windows
1 parent 6988f49 commit ba586d1

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

memory_profiler.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,12 @@
1717
import subprocess
1818
import logging
1919
import traceback
20-
from signal import SIGKILL
21-
20+
if sys.platform == "win32":
21+
# any value except signal.CTRL_C_EVENT and signal.CTRL_BREAK_EVENT
22+
# can be used to kill a process unconditionally in Windows
23+
SIGKILL = -1
24+
else:
25+
from signal import SIGKILL
2226
import psutil
2327

2428

0 commit comments

Comments
 (0)