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', 'mit': '#000099',
} }
for account, color in sorted(account_colors.items()): for account, color in sorted(account_colors.items()):
mail_path = os.path.expanduser('~/.mail/{}/Inbox/new'.format(account))
try: try:
mail_path = os.path.expanduser('~/.mail/{}/Inbox/new'.format(account)) message_count = len(os.listdir(mail_path))
except FileNotFoundError: except FileNotFoundError:
continue continue
message_count = len(os.listdir(mail_path))
colors = {} colors = {}
if message_count: if message_count:
colors['bg'] = color colors['bg'] = color