Exit cleanly when worker processes are missing.
This commit is contained in:
parent
f1902a4d1b
commit
1e45001878
1 changed files with 3 additions and 1 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue