From ce3c42dca9d15c9f33ea214a029f4bab393a0534 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Fri, 18 Jun 2021 12:29:30 +0800 Subject: [PATCH] bugfix --- appPublic/udp_comm.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/appPublic/udp_comm.py b/appPublic/udp_comm.py index 36c4504..8fdabe0 100644 --- a/appPublic/udp_comm.py +++ b/appPublic/udp_comm.py @@ -48,11 +48,15 @@ class UdpComm: def send(self,data,addr): b = json.dumps(data).encode('utf-8') + if isinstance(addr): + addr = tuple(addr) self.udpSerSock.sendto(b,addr) def sends(self,data, addrs): b = json.dumps(data).encode('utf-8') for addr in addrs: + if isinstance(addr): + addr = tuple(addr) self.udpSerSock.sendto(b,addr) if __name__ == '__main__':