From 6168d63699b4c67a45e4685b55bd23ca252d0980 Mon Sep 17 00:00:00 2001 From: Dmitri Bogomolov <4glitch@gmail.com> Date: Wed, 27 Jan 2021 21:40:38 +0200 Subject: [PATCH] Replace formatting socket.error by exc_info in network.udp --- src/network/udp.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/network/udp.py b/src/network/udp.py index ccc7ade8..15804bc9 100644 --- a/src/network/udp.py +++ b/src/network/udp.py @@ -125,9 +125,9 @@ class UDPSocket(BMProto): # pylint: disable=too-many-instance-attributes def handle_read(self): try: - (recdata, addr) = self.socket.recvfrom(self._buf_len) - except socket.error as e: - logger.error("socket error: %s", e) + recdata, addr = self.socket.recvfrom(self._buf_len) + except socket.error: + logger.error("socket error on recvfrom:", exc_info=True) return self.destination = Peer(*addr) @@ -143,7 +143,7 @@ class UDPSocket(BMProto): # pylint: disable=too-many-instance-attributes try: retval = self.socket.sendto( self.write_buf, ('', self.port)) - except socket.error as e: - logger.error("socket error on sendto: %s", e) + except socket.error: + logger.error("socket error on sendto:", exc_info=True) retval = len(self.write_buf) self.slice_write_buf(retval)