Skip to content

Commit

Permalink
Fix ValueError when exiting without active accounts
Browse files Browse the repository at this point in the history
Fixes #46.
  • Loading branch information
horazont committed Mar 1, 2018
1 parent 3868a75 commit 928a4b2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions jclib/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 928a4b2

Please sign in to comment.