From e21652aed73a47e3de8087be09ffeca2eff3bf6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=A9munaire?= Date: Thu, 24 May 2012 20:50:07 +0200 Subject: [PATCH] Add a try/except that catch a mysterious ValueError when bfrseen is None --- qd.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/qd.py b/qd.py index e0f3921..caf5b95 100644 --- a/qd.py +++ b/qd.py @@ -408,8 +408,11 @@ class GameUpdater(threading.Thread): global DELAYED, QUESTIONS, LASTQUESTION if self.bfrseen is not None: - seen = datetime.now() - self.bfrseen - rnd = random.randint(0, int(seen.seconds/90)) + try: + seen = datetime.now() - self.bfrseen + rnd = random.randint(0, int(seen.seconds/90)) + except: + rnd = 1 else: rnd = 1