![](https://secure.gravatar.com/avatar/b525bd392fda602f8ff8377e271cb662.jpg?s=120&d=mm&r=g)
March 30, 2012
12:02 p.m.
On Fri, Mar 30, 2012 at 06:09, Serhiy Storchaka <storchaka@gmail.com> wrote:
P. S. I've had a crazy idea. What if we allow to raise any exception, not only ThreadInterruptionError, in another thread?
Technically you can already do this, but only from C (i.e., from an extension or from the interpreter itself). See PyThreadState_SetAsyncExc(). We do this in our software (which embeds Python in a C program) to raise SystemExit in Python-launched threads before finalizing the interpreter. -- Tim Lesher <tlesher@gmail.com>