Marko Rauhamaa <ma...@pacujo.net> wrote: > Ulli Horlacher <frams...@rus.uni-stuttgart.de>: > > > What is the best practise for a cross platform timeout handler? > > Here's the simplest answer: > > https://docs.python.org/3/library/threading.html#threading.Timer > > (Also available in Python 2.)
Hmmm... not so simple for me. My test code: from time import * import threading import sys def hello(): raise ValueError("hello!!!") t = threading.Timer(3.0,hello) t.start() try: print "start" sleep(5) print "end" except ValueError as e: print e.args[0] sys.exit(1) gives: start Exception in thread Thread-1: Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner self.run() File "/usr/lib/python2.7/threading.py", line 759, in run self.function(*self.args, **self.kwargs) File "x.py", line 7, in hello def hello(): raise ValueError("hello!!!") ValueError: hello!!! end -- Ullrich Horlacher Server und Virtualisierung Rechenzentrum IZUS/TIK E-Mail: horlac...@tik.uni-stuttgart.de Universitaet Stuttgart Tel: ++49-711-68565868 Allmandring 30a Fax: ++49-711-682357 70550 Stuttgart (Germany) WWW: http://www.tik.uni-stuttgart.de/ -- https://mail.python.org/mailman/listinfo/python-list