Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a6a2e99

Browse files
committed
minor update
1 parent c303fea commit a6a2e99

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

lib/utils/timeout.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import threading
44

5+
from lib.core.data import logger
6+
57
def timeout(func, args=(), kwargs={}, duration=1, default=None):
68
class InterruptableThread(threading.Thread):
79
def __init__(self):
@@ -12,7 +14,8 @@ def __init__(self):
1214
def run(self):
1315
try:
1416
self.result = func(*args, **kwargs)
15-
except:
17+
except Exception, msg:
18+
logger.log(8, msg)
1619
self.result = default
1720

1821
thread = InterruptableThread()

0 commit comments

Comments
 (0)