On Mon, Sep 12, 2011 at 8:00 PM, Ulrich Eckhardt
<ulrich.eckha...@dominolaser.com> wrote:
> Now, how should I handle rogue scripts? For example, when a script hangs in
> an endless loop, how do I signal the Python interpreter to shut down? In
> other words, I want to trigger something like what Control-C does in a
> "normal" environment.
>

You can use PyErr_SetInterrupt to raise KeyboardInterrupt, but it can
be caught by the script. There's no guaranteed way, short of killing
the process.

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to