From 0f666eaafe83f35ce91f4237f9f0ad2f76a6194f Mon Sep 17 00:00:00 2001 From: acgnhik <acgnhik@outlook.com> Date: Mon, 6 Jun 2022 12:05:15 +0800 Subject: [PATCH] fix: suppress ProcessLookupError --- src/blrec/core/stream_remuxer.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/blrec/core/stream_remuxer.py b/src/blrec/core/stream_remuxer.py index 162c222..0d0b866 100644 --- a/src/blrec/core/stream_remuxer.py +++ b/src/blrec/core/stream_remuxer.py @@ -1,6 +1,7 @@ import errno import io import logging +from contextlib import suppress import os import re import shlex @@ -88,7 +89,8 @@ class StreamRemuxer(StoppableMixin, SupportDebugMixin): def _do_stop(self) -> None: logger.debug('Stopping stream remuxer...') if hasattr(self, '_subprocess'): - self._subprocess.kill() + with suppress(ProcessLookupError): + self._subprocess.kill() self._subprocess.wait(timeout=10) if hasattr(self, '_thread'): self._thread.join(timeout=10)