Added python2.5 compatibility - this should allow it to run on Leopard

This commit is contained in:
Skyler Lehmkuhl 2012-01-09 12:11:52 -05:00
parent 80241f7f52
commit 16486e1490
1 changed files with 3 additions and 3 deletions

View File

@ -85,14 +85,14 @@ class RepeatTimer(Thread):
def run(self): def run(self):
count = 0 count = 0
while not self.finished.is_set() and (self.iterations <= 0 or count < self.iterations): while not self.finished.isSet() and (self.iterations <= 0 or count < self.iterations):
try: try:
self.finished.wait(self.interval) self.finished.wait(self.interval)
if not self.finished.is_set(): if not self.finished.isSet():
#print self.function #print self.function
self.function(*self.args, **self.kwargs) self.function(*self.args, **self.kwargs)
count += 1 count += 1
except Exception as e: except Exception:
self.cancel() self.cancel()
def cancel(self): def cancel(self):