commit 88a053d349746431d52681571255da066127a01d parent 0493493911a34221c0bd5913cbd8a97cb9ed18a0 Author: tongong <tongong@gmx.net> Date: Fri, 9 Jul 2021 19:57:30 +0200 fixed bug when no datapoints exist Diffstat:
M | timetracker-report | | | 7 | +++++-- |
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/timetracker-report b/timetracker-report @@ -48,8 +48,11 @@ def printGraph(data): # READ AND PARSE FILE #################################################### -# does not handle errors -datafile = open(filelocation(), "r") +try: + datafile = open(filelocation(), "r") +except FileNotFoundError: + print("data is file not there (yet)") + exit(1) # parse input file days = {}