python2.5 compatibility
This commit is contained in:
parent
0f941a7fa3
commit
3b733ce268
1 changed files with 2 additions and 2 deletions
|
|
@ -43,7 +43,7 @@ class IScheduler(object):
|
||||||
|
|
||||||
class RepeatedTimer(_Timer):
|
class RepeatedTimer(_Timer):
|
||||||
def run(self):
|
def run(self):
|
||||||
while not self.finished.is_set():
|
while not self.finished.isSet():
|
||||||
self.function(*self.args, **self.kwargs)
|
self.function(*self.args, **self.kwargs)
|
||||||
self.finished.wait(self.interval)
|
self.finished.wait(self.interval)
|
||||||
self.finished.set()
|
self.finished.set()
|
||||||
|
|
@ -63,7 +63,7 @@ class Scheduler(IScheduler):
|
||||||
return self._schedule(RepeatedTimer, interval, self._repeat_callback, function, *args)
|
return self._schedule(RepeatedTimer, interval, self._repeat_callback, function, *args)
|
||||||
|
|
||||||
def _schedule(self, klass, interval, meta_func, function, *args):
|
def _schedule(self, klass, interval, meta_func, function, *args):
|
||||||
if self.stop_event.is_set():
|
if self.stop_event.isSet():
|
||||||
return
|
return
|
||||||
|
|
||||||
with self.mutex:
|
with self.mutex:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue