From 928a4b24fcb02610ae5461f15b68da84dbd7ff03 Mon Sep 17 00:00:00 2001 From: Jonas Wielicki Date: Thu, 1 Mar 2018 15:06:41 +0100 Subject: [PATCH] Fix ValueError when exiting without active accounts Fixes #46. --- jclib/client.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jclib/client.py b/jclib/client.py index e5bfbe2..3b8b3d8 100644 --- a/jclib/client.py +++ b/jclib/client.py @@ -181,6 +181,10 @@ def on_account_disabled(self, account: identity.Account): @asyncio.coroutine def shutdown(self): futs = [asyncio.Future() for _ in self.clients] + if not futs: + # otherwise, wait complains down the road + return + for fut, client in zip(futs, self.clients.values()): client.on_stopped.connect(fut, client.on_stopped.AUTO_FUTURE) client.on_failure.connect(fut, client.on_failure.AUTO_FUTURE)