From e56974078a5a9e7abc0f182d1aa4b5bd2e0125a6 Mon Sep 17 00:00:00 2001 From: Reza Ameli Date: Tue, 13 May 2025 19:29:00 -0400 Subject: [PATCH] Fix exception handling --- libp2p/transport/tcp/tcp.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libp2p/transport/tcp/tcp.py b/libp2p/transport/tcp/tcp.py index e9a0a7a2..4ed06c98 100644 --- a/libp2p/transport/tcp/tcp.py +++ b/libp2p/transport/tcp/tcp.py @@ -63,13 +63,13 @@ class TCPListener(IListener): await trio.serve_tcp(handler, port, host=host, task_status=task_status) async def handler(stream: trio.SocketStream) -> None: - remote_host : str = "" - remote_port : int = 0 + remote_host: str = "" + remote_port: int = 0 try: tcp_stream = TrioTCPStream(stream) - remote_host,remote_port = tcp_stream.get_remote_address() + remote_host, remote_port = tcp_stream.get_remote_address() await self.handler(tcp_stream) - except Exception as e: + except Exception: logger.debug(f"Connection from {remote_host}:{remote_port} failed.") listeners = await nursery.start(