I think i see what you are trying to do but it depends on the environment and your goals.<div><br></div><div>Generally i think you need to separate your code by forking (or perhaps you have already done that?),</div><div>then you can run a check to see if the process died as expected. I don't know though, this not much</div>

<div>information to go on, but if you are running untrusted code then you need to be able to isolate and kill it.<br><br><div class="gmail_quote">On Sat, Apr 30, 2011 at 6:17 PM, Chris Angelico <span dir="ltr"><<a href="mailto:rosuav@gmail.com">rosuav@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">On Sat, Apr 30, 2011 at 6:08 PM, Miki Tebeka <<a href="mailto:miki.tebeka@gmail.com">miki.tebeka@gmail.com</a>> wrote:<br>


>> In our sandboxed Python environment, I would like to be able to<br>
>> trigger an abort of the currently-running Python script (from a signal<br>
>> handler or another thread).<br>
> There's os.abort<br>
<br>
</div>That core dumps the process; what I want is to force the<br>
PyRun_StringFlags to return. Normally PyErr_SetInterrupt will do<br>
exactly this (within a few instructions is fine), but the Python<br>
script is able to prevent that from happening, which I don't like.<br>
<font color="#888888"><br>
Chris Angelico<br>
</font><div><div></div><div class="h5">--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div><a href="http://dylan-evans.github.com" target="_blank">http://dylan-evans.github.com</a></div><div><br></div>"The UNIX system has a command, nice ... in order to be nice to the other users. Nobody ever uses it." - Andrew S. Tanenbaum<br>


</div>