Fishtest method for kill cutechess and friends
This commit is contained in:
1 parent
90598b8db9
commit
8032c1447c
1 file changed
+9
-2
+9
-2
@@ -40,9 +40,16 @@ except:
|
||||
MACHINE_ID = None
|
||||
print('<Warning> Machine unregistered, will register with Server')
|
||||
|
||||
# Solution taken from Fishtest
|
||||
def killProcess(process):
|
||||
if not IS_WINDOWS : os.system('pkill -TERM -P {0}'.format(process.pid))
|
||||
else : subprocess.call(['taskkill', '/F', '/T', '/PID', str(process.pid)])
|
||||
try:
|
||||
# process.kill doesn't kill subprocesses on Windows
|
||||
if IS_WINDOWS: subprocess.call(['taskkill', '/F', '/T', '/PID', str(process.pid)])
|
||||
else: process.kill()
|
||||
process.wait()
|
||||
process.stdout.close()
|
||||
except:
|
||||
pass
|
||||
|
||||
def getNameAsExe(program):
|
||||
if IS_WINDOWS: return program + '.exe'
|
||||
|
||||
Reference in new issue
Block a user