1
0
Fork 0

Actually wrap the right line in try-except

This commit is contained in:
Jeremy Kaplan 2016-08-14 13:19:36 -04:00
commit bb4ec60da8

View file

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