From 11fd918d6266b059993566626682f14639b6b248 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Tue, 21 Jul 2020 20:33:48 +0200 Subject: [PATCH] handle more errors the right way, refs #144 --- owrx/connection.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/owrx/connection.py b/owrx/connection.py index ac9c35c..3712b64 100644 --- a/owrx/connection.py +++ b/owrx/connection.py @@ -35,7 +35,7 @@ class Client(ABC): try: data = self.multiprocessingPipe.get() self.send(data) - except (EOFError, OSError): + except (EOFError, OSError, ValueError): run = False except Exception: logger.exception("Exception on client multiprocessing queue") @@ -53,9 +53,12 @@ class Client(ABC): def close(self): self.conn.close() - self.multiprocessingPipe.close() + if self.multiprocessingPipe is not None: + self.multiprocessingPipe.close() def mp_send(self, data): + if self.multiprocessingPipe is None: + return try: self.multiprocessingPipe.put(data, block=False) except Full: