I think i see what you are trying to do but it depends on the environment and your goals.
Generally i think you need to separate your code by forking (or perhaps you have already done that?), then you can run a check to see if the process died as expected. I don't know though, this not much information to go on, but if you are running untrusted code then you need to be able to isolate and kill it. On Sat, Apr 30, 2011 at 6:17 PM, Chris Angelico <ros...@gmail.com> wrote: > On Sat, Apr 30, 2011 at 6:08 PM, Miki Tebeka <miki.teb...@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 > -- > http://mail.python.org/mailman/listinfo/python-list > -- http://dylan-evans.github.com "The UNIX system has a command, nice ... in order to be nice to the other users. Nobody ever uses it." - Andrew S. Tanenbaum
-- http://mail.python.org/mailman/listinfo/python-list