Always logout() on imaplib2 objects, even during exceptions

Without this, trying to Ctrl-C out of offlineimap will go into a hang.

Signed-off-by: Ethan Glasser-Camp <ethan@betacantrips.com>
Reviewed-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
Ethan Glasser-Camp 2011-03-24 14:51:10 -04:00 committed by Nicolas Sebrecht
parent 51b89e6c43
commit 105da1b0c3
2 changed files with 3 additions and 2 deletions

View File

@ -19,6 +19,8 @@ Changes
Bug Fixes
---------
* Fix hang when using Ctrl+C in some cases.
Pending for the next major release
==================================

View File

@ -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)