From 95e4562b293f37d0326a32eb132fe58503a58adb Mon Sep 17 00:00:00 2001 From: Lara Date: Mon, 2 Mar 2020 17:07:08 -0500 Subject: [PATCH] [work] Fix division by zero --- bin/work | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/work b/bin/work index c1f76f8..02c61bf 100755 --- a/bin/work +++ b/bin/work @@ -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),