From bb4ec60da8334427b8df7ec478c758083203e253 Mon Sep 17 00:00:00 2001 From: Jeremy Kaplan Date: Sun, 14 Aug 2016 13:19:36 -0400 Subject: [PATCH] Actually wrap the right line in try-except --- panel/panel_bar.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/panel/panel_bar.py b/panel/panel_bar.py index 8134be5..24f0bc8 100755 --- a/panel/panel_bar.py +++ b/panel/panel_bar.py @@ -111,11 +111,11 @@ def mail_update(_): 'mit': '#000099', } for account, color in sorted(account_colors.items()): + mail_path = os.path.expanduser('~/.mail/{}/Inbox/new'.format(account)) try: - mail_path = os.path.expanduser('~/.mail/{}/Inbox/new'.format(account)) + message_count = len(os.listdir(mail_path)) except FileNotFoundError: continue - message_count = len(os.listdir(mail_path)) colors = {} if message_count: colors['bg'] = color