more update

This commit is contained in:
Miroslav Stampar
2010-04-06 15:12:52 +00:00
parent c24f1cc07c
commit e2810003ae
9 changed files with 39 additions and 40 deletions

View File

@@ -7,14 +7,12 @@ def timeout(func, args=(), kwargs={}, duration=1, default=None):
def __init__(self):
threading.Thread.__init__(self)
self.exceeded = False
self.exceptionMsg = None
self.result = None
def run(self):
try:
self.result = func(*args, **kwargs)
except Exception, msg:
self.exceptionMsg = msg
except:
self.result = default
thread = InterruptableThread()