From 0cece58b291adf043266dae0cf38369e76dd9589 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Thu, 9 Sep 2021 10:11:47 +0200 Subject: [tanken] specify expected Errors --- tanken.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tanken.py b/tanken.py index 303e3b3..b19fb53 100644 --- a/tanken.py +++ b/tanken.py @@ -10,7 +10,7 @@ def tanken(drives, cost, service_charge=0): for d in drives: try: d[0] = int(d[0]) - except: + except (IndexError, ValueError): return None, "Lines have to start with the driven distance!" # calculate overall distance -- cgit v1.2.3