Exit cleanly when worker processes are missing.

This commit is contained in:
Andrew Hamilton 2020-10-15 13:15:41 +10:00
parent f1902a4d1b
commit 1e45001878

View file

@ -4,6 +4,7 @@
# Licensed under the Artistic License 2.0.
import asyncio
import contextlib
import os
import signal
@ -74,7 +75,8 @@ class Worker:
def kill(self):
if self.child_pgid is not None:
os.killpg(self.child_pgid, signal.SIGKILL)
with contextlib.suppress(ProcessLookupError):
os.killpg(self.child_pgid, signal.SIGKILL)
def make_result_widget(text, result, compression):