From 28cc8a7f86e2104da4c17f86a7e179a3e67df62b Mon Sep 17 00:00:00 2001 From: lukken <lukken@astron.nl> Date: Tue, 21 Sep 2021 11:14:55 +0000 Subject: [PATCH] L2SS-340: Let UDPReceiver baseclass handle __del__ --- devices/clients/udp_receiver.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/devices/clients/udp_receiver.py b/devices/clients/udp_receiver.py index 8dd10f41a..160e897b9 100644 --- a/devices/clients/udp_receiver.py +++ b/devices/clients/udp_receiver.py @@ -27,12 +27,12 @@ class UDPReceiver(Thread, StatisticsClientThread): try: self.host = self.options['udp_host'] - except Exception: + except KeyError: raise try: self.port = self.options['udp_port'] - except Exception: + except KeyError: raise self.poll_timeout = self.options['poll_timeout'] @@ -123,6 +123,3 @@ class UDPReceiver(Thread, StatisticsClientThread): if self.is_alive(): # there is nothing we can do except wait (stall) longer, which could be indefinitely. logger.error(f"UDP thread for {self.host}:{self.port} did not shut down after {self.DISCONNECT_TIMEOUT} seconds, just leaving it dangling. Please attach a debugger to thread ID {self.ident}.") - - def __del__(self): - self.disconnect() -- GitLab