[work] Fix division by zero

This commit is contained in:
Lara 2020-03-02 17:07:08 -05:00
parent 6ced297495
commit 95e4562b29

View file

@ -81,9 +81,9 @@ def work(args):
total_delta += delta
count += 1
eight_h = timedelta(hours=8) * count
mean_time = total_delta / count
mean_time = total_delta / count if count > 0 else total_delta
minutes = total_delta - eight_h
month_mean_time = month_delta / month_count
month_mean_time = month_delta / month_count if month_count > 0 else month_delta
month_min = month_delta - timedelta(hours=(8 * month_count))
print("stats: {}, {}".format(
td_format(mean_time),