On Mon, Jun 20, 2011 at 12:42 AM, Laurent Claessens <moky.m...@gmail.com> wrote: > Hello > > > I've a list of tasks to perform. Each of them is a threading.Thread. > Basically I have : > > while task_list : > task = task_list[0] > task.run() > task_list.remove(task)
I'm not understanding what you're doing with threads here. Are you using threading.Thread but then calling its run() method synchronously? Normally threads are used for asynchronous operations. You would then use the start() method to spin the thread off; it will return almost immediately, and the thread will run to completion in parallel with you. But then you can't halt the main loop, because it will have already finished by the time you detect the IOError (starting a bunch of threads is pretty quick). On the other hand, the code you're showing seems to simply call each thread's run() method one by one, which should propagate any exceptions in the same way that function calls usually do. Can you share the code for one of the tasks, and show what happens when it raises an exception? Chris Angelico -- http://mail.python.org/mailman/listinfo/python-list