fix improperly handled CancelledError on shutdown

This commit is contained in:
Jack Robison 2019-01-09 11:29:28 -05:00 committed by Lex Berezhny
parent 442138ef36
commit f4bf260cdb

View file

@ -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