Skip to content

Commit

Permalink
1004 fixed kill process issue on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
tian50 committed Oct 4, 2021
1 parent 719ce8b commit 6ffd8ba
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion msgpi/utils/exec.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ def run(cmd, timeout, scrnout):
stdout, stderr = proc.communicate(timeout=timeout)
except sbp.TimeoutExpired as e:
print('TimeoutExpired')
os.killpg(os.getpgid(proc.pid), signal.SIGTERM)
if platform.system() == 'Windows':
proc.kill()
elif platform.system() == 'Linux':
os.killpg(os.getpgid(proc.pid), signal.SIGTERM)
print('Process killed')

0 comments on commit 6ffd8ba

Please sign in to comment.