Python module which allows you to specify timeouts when calling any existing function, and support for stoppable threads
Increase times in unit tests to ensure passing on slow systems
Allow instantiating FunctionTimedOut exception without arguments ( will replace function name with "Unknown Function" and timedOutAfter with "Unknown" when absent). With test.
Update runTests.py from latest GoodTests distrib, 3.0.5 from 2.1.1
Regenerate docs
Merge patch by Rafal Florczak to use threading.Thread.is_alive vs now deprecated threading.Thread.isAlive
Regenerate docs
Merge patch by Rafal Florczak to use threading.Thread.is_alive vs now deprecated threading.Thread.isAlive
Regenerate docs
Update docs, update README, note that this still works with Python 3.7
Update link to pydocs to be on githubpreview, as python hosted is broke right now.
Re-release of 4.3.1 with updated pydoc link
Update docs, update README, note that this still works with Python 3.7
Update link to pydocs to be on githubpreview, as python hosted is broke right now.
If func_timeout completes the function call in the alloted time, explicitly clean up the thread (previously we were only cleaning it up in the time-out path). On python3 it would get cleaned up anyway on the next garbage collection cycle, on python2 it's a bit more finnikey (but will also, eventually, get automatically joined)
Be better at the traceback. Exclude the funcwrap from the call, and ensure the raised Exception follows the actual path of execution (can be confusing to read at first glance, but your function is at the bottom, then goes around a bit.)
This uses PEP409/3134 in Python3 (available in 3.3+, we support 3.4+ officially).
Python2 doesn't have this, but has it's own syntax that doesn't work in python3 to allow throwing a custom traceback.
You'd think both would support both, or at least python3 support both...
Anyway, this causes a kinda silly import-hack and adds an extra frame to the exception handling part, but works to prevent default handlers from picking it up.
This solves the multiple prints of exceptions on python3 in certain circumstances(you catching and then raising an exception)
Fixup short delay after a thread times out
Fix where in some cases (depending on what was execution when abort was
called), a default handler could print the tracback to stderr outside of the scope of the normal raise (it would still be raised, just handled twice).
Add a function decorator which provides a default timeout, allows that timeout to be overriden by adding a "forceTimeout" kwarg to the function (configurable), or even running a function to calculate the timeout based on args for each call
Some improvements to python2 support
Add GoodTests (Unit tests)
Fixup short delay after a thread times out
Fix where in some cases (depending on what was execution when abort was
called), a default handler could print the tracback to stderr outside of the scope of the normal raise (it would still be raised, just handled twice).
Add a function decorator which provides a default timeout, allows that timeout to be overriden by adding a "forceTimeout" kwarg to the function (configurable), or even running a function to calculate the timeout based on args for each call
Some improvements to python2 support
Add GoodTests (Unit tests)