From beaaf77a1acdf1745ef303b770cf89134fbe8b22 Mon Sep 17 00:00:00 2001 From: Ilias Tsitsimpis Date: Thu, 9 Aug 2018 00:01:27 +0300 Subject: [PATCH] Do not use TIMEOUT_MAX for Condition.wait() On some architectures, using threading.TIMEOUT_MAX for the timeout parameter can overflow causing Condition.wait() to return immediately. Instead of relying on TIMEOUT_MAX, remove it and wait forever. Signed-off-by: Ilias Tsitsimpis Signed-off-by: Nicolas Sebrecht --- offlineimap/bundled_imaplib2.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/offlineimap/bundled_imaplib2.py b/offlineimap/bundled_imaplib2.py index f0ed96b..3158d7d 100755 --- a/offlineimap/bundled_imaplib2.py +++ b/offlineimap/bundled_imaplib2.py @@ -67,7 +67,6 @@ if bytes != str: else: import Queue as queue string_types = basestring - threading.TIMEOUT_MAX = 9223372036854.0 select_module = select @@ -192,7 +191,7 @@ class Request(object): def get_response(self, exc_fmt=None): self.callback = None if __debug__: self.parent._log(3, '%s:%s.ready.wait' % (self.name, self.tag)) - self.ready.wait(threading.TIMEOUT_MAX) + self.ready.wait() if self.aborted is not None: typ, val = self.aborted @@ -1400,7 +1399,7 @@ class IMAP4(object): self.commands_lock.release() if need_event: if __debug__: self._log(3, 'sync command %s waiting for empty commands Q' % name) - self.state_change_free.wait(threading.TIMEOUT_MAX) + self.state_change_free.wait() if __debug__: self._log(3, 'sync command %s proceeding' % name) if self.state not in Commands[name][CMD_VAL_STATES]: