return "None" timeouts when there's no servers in IRCBot.servers
This commit is contained in:
parent
b6eae3220c
commit
656cb8153a
1 changed files with 4 additions and 0 deletions
|
@ -91,11 +91,15 @@ class Bot(object):
|
||||||
timeouts = []
|
timeouts = []
|
||||||
for server in self.servers.values():
|
for server in self.servers.values():
|
||||||
timeouts.append(server.until_next_ping())
|
timeouts.append(server.until_next_ping())
|
||||||
|
if not timeouts:
|
||||||
|
return None
|
||||||
return min(timeouts)
|
return min(timeouts)
|
||||||
def next_read_timeout(self):
|
def next_read_timeout(self):
|
||||||
timeouts = []
|
timeouts = []
|
||||||
for server in self.servers.values():
|
for server in self.servers.values():
|
||||||
timeouts.append(server.until_read_timeout())
|
timeouts.append(server.until_read_timeout())
|
||||||
|
if not timeouts:
|
||||||
|
return None
|
||||||
return min(timeouts)
|
return min(timeouts)
|
||||||
|
|
||||||
def get_poll_timeout(self):
|
def get_poll_timeout(self):
|
||||||
|
|
Loading…
Reference in a new issue