i3pystatus/ice-status.py: fix error when seconds is None

As recommended by vonbirne in kunsi/dotfiles#2
This commit is contained in:
Franzi 2021-12-09 10:44:58 +01:00
parent 239d003192
commit 88ed4d22f0
Signed by untrusted user: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -8,6 +8,8 @@ from sys import exit
# bundlewrap.utils.text.format_duration, but trimmed down # bundlewrap.utils.text.format_duration, but trimmed down
def format_time(seconds): def format_time(seconds):
if seconds is None:
return "?"
components = [] components = []
if seconds >= 3600: if seconds >= 3600:
hours = int(seconds / 3600) hours = int(seconds / 3600)