embedding: forcing an interpreter to end

Miki Tebeka miki.tebeka at zoran.com
Tue Dec 21 01:52:56 EST 2004


Hello dan,

> > How about: PyRun_String("from os import _exit;
> > _exit(0)") ?
> 
> Clever!  But, _exit() will terminate my entire
> process, not just the offending interpreter.  And I
> can't use a separate child process on uclinux.
You have a Python port to uClinux?
 
> Any other ideas?
1.
Maybe: PyRun_String("raise SystemExit")?
Which supposed to be less brute.
2.
Is there any signal handler you can use in your C program? Maybe signling
yourself will get the control back to the C program and then you can kill
the interpreter.

Bye.
--
------------------------------------------------------------------------
Miki Tebeka <miki.tebeka at zoran.com>
http://tebeka.bizhat.com
The only difference between children and adults is the price of the toys



More information about the Python-list mailing list