From f4bf260cdba59c9402e560bb5adc0a599e936c74 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Wed, 9 Jan 2019 11:29:28 -0500 Subject: [PATCH] fix improperly handled CancelledError on shutdown --- torba/client/basenetwork.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/torba/client/basenetwork.py b/torba/client/basenetwork.py index f6c85c9b8..c1d5f31ef 100644 --- a/torba/client/basenetwork.py +++ b/torba/client/basenetwork.py @@ -88,7 +88,9 @@ class BaseNetwork: self._on_connected_controller.add(True) delay = 0.0 await self.client.on_disconnected.first - except (Exception, CancelledError): # pylint: disable=broad-except + except CancelledError: + self.running = False + except Exception: # pylint: disable=broad-except log.exception("Connecting to %s raised an exception:", connection_string) if not self.running: return