Aborting Python from C code

Chris Angelico rosuav at gmail.com
Sat Apr 30 04:17:10 EDT 2011


On Sat, Apr 30, 2011 at 6:08 PM, Miki Tebeka <miki.tebeka at gmail.com> wrote:
>> In our sandboxed Python environment, I would like to be able to
>> trigger an abort of the currently-running Python script (from a signal
>> handler or another thread).
> There's os.abort

That core dumps the process; what I want is to force the
PyRun_StringFlags to return. Normally PyErr_SetInterrupt will do
exactly this (within a few instructions is fine), but the Python
script is able to prevent that from happening, which I don't like.

Chris Angelico



More information about the Python-list mailing list