Commit e7a3c47e by Seyyed Hossein Hasanpour Committed by GitHub

Fixed process termination routine in windows (#4844)

* Fixed process termination routine in windows

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

* Update server.py
parent e33de246
......@@ -403,7 +403,10 @@ class Server(object):
"""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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment