31 Mar
2012
31 Mar
'12
2:04 a.m.
On Fri, 30 Mar 2012 21:14:43 +1100
Steven D'Aprano
Matt Joiner wrote:
Wouldn't it be better to raise a SystemExit in a thread you want interrupted?
I must admit I'm rather confused about this suggestion. Do you mean the thread itself should raise SystemExit? If so, why not just exit the normal way?
If you mean the main thread somehow injects a SystemExit in another thread, how would you do that? Perhaps I'm missing something obvious, but I don't know how to do that.
http://docs.python.org/dev/c-api/init.html#PyThreadState_SetAsyncExc Regards Antoine.