return "None" timeouts when there's no servers in IRCBot.servers

This commit is contained in:
jesopo 2018-08-30 17:20:55 +01:00
parent b6eae3220c
commit 656cb8153a

View file

@ -91,11 +91,15 @@ class Bot(object):
timeouts = []
for server in self.servers.values():
timeouts.append(server.until_next_ping())
if not timeouts:
return None
return min(timeouts)
def next_read_timeout(self):
timeouts = []
for server in self.servers.values():
timeouts.append(server.until_read_timeout())
if not timeouts:
return None
return min(timeouts)
def get_poll_timeout(self):