Decrease thread join time. Because it is a daemon thread it will get closed automatically on garbage collect, just need to initate a join at all.

This commit is contained in:
Tim Savannah 2017-05-20 16:21:43 -04:00
parent 5b93fe5d7c
commit 36b7d6f266

View File

@ -80,7 +80,7 @@ def func_timeout(timeout, func, args=(), kwargs=None):
isStopped = True
stopException = FunctionTimedOut
thread._stopThread(stopException)
thread.join(.1)
thread.join(min(.1, timeout / 50.0))
raise FunctionTimedOut('', timeout, func, args, kwargs)
if exception: