From a0eb56421f50de179f6cf386d21ca68ac0a8993f Mon Sep 17 00:00:00 2001 From: Joeri Exelmans Date: Thu, 21 Nov 2024 14:20:54 +0100 Subject: [PATCH] fix --- util/simulator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/simulator.py b/util/simulator.py index 4949a3f..cdbe6a6 100644 --- a/util/simulator.py +++ b/util/simulator.py @@ -53,10 +53,10 @@ class InteractiveDecisionMaker(DecisionMaker): sys.stdout.write(f"{self.msg} ") try: raw = input() - choice = int(ord(raw)-97) # may raise ValueError + choice = ord(raw)-97 # may raise ValueError if choice >= 0 and choice < len(arr): return arr[choice] - except ValueError: + except (ValueError, TypeError): pass print("Invalid option") return __choose()