From 656cb8153a5db981152b852373d728734f1c2e44 Mon Sep 17 00:00:00 2001 From: jesopo Date: Thu, 30 Aug 2018 17:20:55 +0100 Subject: [PATCH] return "None" timeouts when there's no servers in IRCBot.servers --- IRCBot.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/IRCBot.py b/IRCBot.py index f803d61d..185abf83 100644 --- a/IRCBot.py +++ b/IRCBot.py @@ -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):