fix: suppress ProcessLookupError
This commit is contained in:
parent
f3e9df6d9d
commit
0f666eaafe
@ -1,6 +1,7 @@
|
|||||||
import errno
|
import errno
|
||||||
import io
|
import io
|
||||||
import logging
|
import logging
|
||||||
|
from contextlib import suppress
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import shlex
|
import shlex
|
||||||
@ -88,7 +89,8 @@ class StreamRemuxer(StoppableMixin, SupportDebugMixin):
|
|||||||
def _do_stop(self) -> None:
|
def _do_stop(self) -> None:
|
||||||
logger.debug('Stopping stream remuxer...')
|
logger.debug('Stopping stream remuxer...')
|
||||||
if hasattr(self, '_subprocess'):
|
if hasattr(self, '_subprocess'):
|
||||||
self._subprocess.kill()
|
with suppress(ProcessLookupError):
|
||||||
|
self._subprocess.kill()
|
||||||
self._subprocess.wait(timeout=10)
|
self._subprocess.wait(timeout=10)
|
||||||
if hasattr(self, '_thread'):
|
if hasattr(self, '_thread'):
|
||||||
self._thread.join(timeout=10)
|
self._thread.join(timeout=10)
|
||||||
|
Loading…
Reference in New Issue
Block a user