diff --git a/bittensor_cli/src/bittensor/async_substrate_interface.py b/bittensor_cli/src/bittensor/async_substrate_interface.py index 464635958..c953d02f5 100644 --- a/bittensor_cli/src/bittensor/async_substrate_interface.py +++ b/bittensor_cli/src/bittensor/async_substrate_interface.py @@ -679,7 +679,10 @@ async def _exit_with_timer(self): async def shutdown(self): async with self._lock: - self._receiving_task.cancel() + try: + self._receiving_task.cancel() + except AttributeError: + pass try: await self._receiving_task except asyncio.CancelledError: