diff --git a/bittensor_cli/src/bittensor/async_substrate_interface.py b/bittensor_cli/src/bittensor/async_substrate_interface.py index c953d02f5..0268a39a2 100644 --- a/bittensor_cli/src/bittensor/async_substrate_interface.py +++ b/bittensor_cli/src/bittensor/async_substrate_interface.py @@ -681,11 +681,8 @@ async def shutdown(self): async with self._lock: try: self._receiving_task.cancel() - except AttributeError: - pass - try: await self._receiving_task - except asyncio.CancelledError: + except (AttributeError, asyncio.CancelledError): pass await self.ws.close() self.ws = None