diff --git a/aioamqp/protocol.py b/aioamqp/protocol.py index 9c916c4..38946c5 100644 --- a/aioamqp/protocol.py +++ b/aioamqp/protocol.py @@ -285,7 +285,9 @@ def run(self): except exceptions.AmqpClosedConnection as exc: logger.info("Close connection") self.stop_now.set_result(None) - + self._close_channels(exception=exc) + except asyncio.CancelledError as exc: + self.stop_now.set_result(None) self._close_channels(exception=exc) except Exception: # pylint: disable=broad-except logger.exception('error on dispatch')