[PATCH 4/5] IMAP IDLE cleanup(4): Simplify code

Sebastian Spaeth Sebastian at SSpaeth.de
Mon Sep 12 09:37:56 BST 2011


    while True: if a: return

is equivalent to

   while not a:

Signed-off-by: Sebastian Spaeth <Sebastian at SSpaeth.de>
---
 offlineimap/imapserver.py |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/offlineimap/imapserver.py b/offlineimap/imapserver.py
index df2318c..f4fc7fa 100644
--- a/offlineimap/imapserver.py
+++ b/offlineimap/imapserver.py
@@ -514,9 +514,7 @@ class IdleThread(object):
                 self.imapaborted = True
                 self.stop()
 
-        while True:
-            if self.stop_sig.isSet():
-                return
+        while not self.stop_sig.isSet():
             self.needsync = False
             self.imapaborted = False
 
-- 
1.7.4.1





More information about the OfflineIMAP-project mailing list