diff --git a/lib/utils/timeout.py b/lib/utils/timeout.py index e68eb2c7b..1b6d22aa8 100644 --- a/lib/utils/timeout.py +++ b/lib/utils/timeout.py @@ -8,7 +8,6 @@ def timeout(func, args=(), kwargs={}, duration=1, default=None): class InterruptableThread(threading.Thread): def __init__(self): threading.Thread.__init__(self) - self.exceeded = False self.result = None def run(self): @@ -21,8 +20,7 @@ def timeout(func, args=(), kwargs={}, duration=1, default=None): thread = InterruptableThread() thread.start() thread.join(duration) - self.exceeded = thread.isAlive() - if self.exceeded: + if thread.isAlive(): return default else: return thread.result