Make code compatible with python-2.6

In python 2.6 Event.wait() always returns None making condition always True.
This commit is contained in:
ZyX 2014-02-26 08:24:56 +04:00
parent acff89a8e9
commit 7df8918b39
1 changed files with 4 additions and 1 deletions

View File

@ -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: