Actually wrap the right line in try-except
This commit is contained in:
parent
28d0527b54
commit
bb4ec60da8
1 changed files with 2 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue