From: Dmitrij D. Czarkoff Date: Thu, 21 Jan 2016 09:36:30 +0000 (+0100) Subject: check_mail.py: more detailed report on IOError X-Git-Tag: 2.11~44^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=cc77338ff47ed2035d7447db4299b862fd184207;p=i3%2Fi3status check_mail.py: more detailed report on IOError When user doesn't have permissions to access some file, he is better served by exact error message python recieved then by statement "not a mailbox". --- diff --git a/contrib/check_mail.py b/contrib/check_mail.py index 14d2e82..ac23f77 100755 --- a/contrib/check_mail.py +++ b/contrib/check_mail.py @@ -82,6 +82,9 @@ def check_mail(label, nomail, ignore, colors): else: return nomail, colors[0] + except IOError, exception: + return '{0}: {1}'.format(name, exception.strerror), colors[2] + except: pass