From adec220ed4a1a90fce6bc15990325b6a71c52915 Mon Sep 17 00:00:00 2001 From: VG Date: Thu, 19 May 2016 13:18:12 +0200 Subject: Remove double connection exception handling --- climl/imap.py | 16 ++++------------ 1 file 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): -- cgit v1.2.3