Skip to content

Commit

Permalink
Fixed process termination routine in windows (apache#4844)
Browse files Browse the repository at this point in the history
* Fixed process termination routine in windows

addresses and Fixes AttributeError: module 'os' has no attribute 'killpg' error in apache#4821

* Update server.py
  • Loading branch information
Coderx7 authored and alexwong committed Feb 26, 2020
1 parent 812b612 commit 8e7e7e7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion python/tvm/rpc/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,10 @@ def terminate(self):
"""Terminate the server process"""
if self.use_popen:
if self.proc:
os.killpg(self.proc.pid, signal.SIGTERM)
if platform.system() == "Windows":
os.kill(self.proc.pid, signal.CTRL_C_EVENT)
else:
os.killpg(self.proc.pid, signal.SIGTERM)
self.proc = None
else:
if self.proc:
Expand Down

0 comments on commit 8e7e7e7

Please sign in to comment.