We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5893857 commit 8f2ba4aCopy full SHA for 8f2ba4a
tests/test_windows.py
@@ -132,7 +132,12 @@ def check_pid(pid: int) -> bool:
132
def kill_pid(
133
pid: int, sig: Optional[int] = None, process_group: Optional[bool] = None
134
) -> bool:
135
- os.kill(pid, signal.SIGTERM if sig is None else sig)
+ try:
136
+ os.kill(pid, signal.SIGTERM if sig is None else sig)
137
+ except PermissionError as e:
138
+ if check_pid(pid) is False:
139
+ return False
140
+ return True
141
142
143
def task_kill(pid):
0 commit comments