diff options
author | VG <vg@devys.org> | 2016-05-19 13:18:12 +0200 |
---|---|---|
committer | VG <vg@devys.org> | 2016-05-19 13:18:12 +0200 |
commit | adec220ed4a1a90fce6bc15990325b6a71c52915 (patch) | |
tree | 002f06d5544462c125cd0198b0ee80c499c766db | |
parent | 473bcd0e3e7c545c36159356ceacb809836c963d (diff) | |
download | climl-adec220ed4a1a90fce6bc15990325b6a71c52915.tar.gz climl-adec220ed4a1a90fce6bc15990325b6a71c52915.tar.bz2 climl-adec220ed4a1a90fce6bc15990325b6a71c52915.zip |
Remove double connection exception handling
-rw-r--r-- | climl/imap.py | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/climl/imap.py b/climl/imap.py index 0de15d8..5bd2834 100644 --- a/climl/imap.py +++ b/climl/imap.py @@ -51,18 +51,10 @@ def connect_to_imap(conf, password): connection.login(username=conf.get('imap.username'), password=password) print('successfuly logged') - # TODO: replace shutdown by logouts when it will not timeout through ssl - try: - yield connection - #connection.logout() - except (connection.AbortError, socket.error, socket.timeout, - backports.ssl.SSLError, backports.ssl.CertificateError): - raise - else: - pass - #connection.logout() - finally: - connection.shutdown() + # never try to shutdown socket or send a logout since the goal of climl is + # to stay connected, if this fails it is an error and thus no need to try + # to be nice with a logout to a dead connection. + yield connection def imap_waiter(connection): |