From 7df8918b39e0b8e8469aa0ca98b1fb85a86c4f6b Mon Sep 17 00:00:00 2001 From: ZyX Date: Wed, 26 Feb 2014 08:24:56 +0400 Subject: [PATCH] Make code compatible with python-2.6 In python 2.6 Event.wait() always returns None making condition always True. --- powerline/lib/threaded.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/powerline/lib/threaded.py b/powerline/lib/threaded.py index cae9c991..b253ae8f 100644 --- a/powerline/lib/threaded.py +++ b/powerline/lib/threaded.py @@ -84,7 +84,10 @@ class ThreadedSegment(MultiRunnedThread): def run(self): if self.do_update_first: start_time = monotonic() - while not self.shutdown_event.wait(max(self.interval - (monotonic() - start_time), self.min_sleep_time)): + while True: + self.shutdown_event.wait(max(self.interval - (monotonic() - start_time), self.min_sleep_time)) + if self.shutdown_event.is_set(): + break start_time = monotonic() self.set_update_value() else: