From a1cc2e778cad5f0b561007dcfc7adb69497cc7b4 Mon Sep 17 00:00:00 2001 From: jesopo Date: Mon, 24 Jun 2019 17:22:08 +0100 Subject: [PATCH] Return 0 seconds if timeout seconds is negative --- src/IRCBot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/IRCBot.py b/src/IRCBot.py index d3948a58..096a2156 100644 --- a/src/IRCBot.py +++ b/src/IRCBot.py @@ -207,7 +207,7 @@ class Bot(object): timeouts.append(self.next_read_timeout()) timeouts.append(self.cache.next_expiration()) min_secs = min([timeout for timeout in timeouts if not timeout == None]) - return min_secs + return max([min_secs, 0]) def disconnect(self, server: IRCServer.Server): del self.servers[server.fileno()]