From bfaebf0085cf596a18719c0dc5b231700b65b91a Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Mon, 28 Jan 2019 15:06:33 -0500 Subject: [PATCH] fix timeout error --- lbrynet/dht/protocol/async_generator_junction.py | 2 +- lbrynet/dht/protocol/protocol.py | 2 +- lbrynet/extras/daemon/Daemon.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lbrynet/dht/protocol/async_generator_junction.py b/lbrynet/dht/protocol/async_generator_junction.py index 3993f4b2b..cbcb1ba84 100644 --- a/lbrynet/dht/protocol/async_generator_junction.py +++ b/lbrynet/dht/protocol/async_generator_junction.py @@ -100,6 +100,6 @@ class AsyncGeneratorJunction: pass finally: if exc_type: - if exc_type not in (asyncio.CancelledError, asyncio.TimeoutError, StopAsyncIteration): + if exc_type not in (asyncio.CancelledError, asyncio.TimeoutError, StopAsyncIteration, GeneratorExit): err = traceback.format_exception(exc_type, exc, tb) log.error(err) diff --git a/lbrynet/dht/protocol/protocol.py b/lbrynet/dht/protocol/protocol.py index 6192c754b..cf1915489 100644 --- a/lbrynet/dht/protocol/protocol.py +++ b/lbrynet/dht/protocol/protocol.py @@ -218,7 +218,7 @@ class PingQueue: await self._protocol.add_peer(p) return await self._protocol.get_rpc_peer(p).ping() - except TimeoutError: + except asyncio.TimeoutError: pass while True: diff --git a/lbrynet/extras/daemon/Daemon.py b/lbrynet/extras/daemon/Daemon.py index ce2e3ef03..3c5466b74 100644 --- a/lbrynet/extras/daemon/Daemon.py +++ b/lbrynet/extras/daemon/Daemon.py @@ -2815,7 +2815,7 @@ class Daemon(metaclass=JSONRPCServerType): try: result = await peer.ping() return result.decode() - except TimeoutError: + except asyncio.TimeoutError: return {'error': 'ping timeout'} @requires(DHT_COMPONENT)