From 3f2ce0a5708114f588135c7e27c98ce621dbb993 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kim=20Silkeb=C3=A6kken?= Date: Mon, 28 Jan 2013 14:02:03 +0100 Subject: [PATCH] Catch the correct imaplib exception --- powerline/segments/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/powerline/segments/common.py b/powerline/segments/common.py index ed94e65a..4183853a 100644 --- a/powerline/segments/common.py +++ b/powerline/segments/common.py @@ -241,7 +241,7 @@ def email_imap_alert(username, password, server='imap.gmail.com', port=993, fold mail.login(username, password) rc, message = mail.status(folder, "(UNSEEN)") unread_count = re.search("UNSEEN (\d+)", message[0]).group(1) - except (imaplib.error, AttributeError): + except (imaplib.IMAP4.error, AttributeError): return None if not unread_count: return None