diff --git a/aio_pika/tools.py b/aio_pika/tools.py index b7639f2c..9ff77c37 100644 --- a/aio_pika/tools.py +++ b/aio_pika/tools.py @@ -38,10 +38,12 @@ def iscoroutinepartial(fn: Callable[..., Any]) -> bool: def _task_done(future: asyncio.Future) -> None: - if not future.cancelled(): + try: exc = future.exception() if exc is not None: raise exc + except asyncio.CancelledError: + pass def create_task(