[PATCH] Always logout() on imaplib2 objects, even during exceptions

Ethan Glasser-Camp ethan at betacantrips.com
Thu Mar 24 10:14:02 GMT 2011


Without this, trying to Ctrl-C out of offlineimap will go into a hang.
---
 offlineimap/accounts.py |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/offlineimap/accounts.py b/offlineimap/accounts.py
index e806151..965052b 100644
--- a/offlineimap/accounts.py
+++ b/offlineimap/accounts.py
@@ -265,10 +265,9 @@ class SyncableAccount(Account):
             mbnames.write()
             localrepos.forgetfolders()
             remoterepos.forgetfolders()
+        finally:
             localrepos.holdordropconnections()
             remoterepos.holdordropconnections()
-        finally:
-            pass
 
         hook = self.getconf('postsynchook', '')
         self.callhook(hook)
-- 
1.7.1


--------------060302060207020108040202--



More information about the OfflineIMAP-project mailing list