embedded python - cancel "while 1: pass"

Warren Postma embed at NO_SPAM_PLEASE.geocities.com
Wed Jan 3 13:25:17 EST 2001


I have to be able to stop a Python script that's executing inside my C
application if it hits a bit of stupid code like:

while 1:
    pass


So what do I do?   I've got Python 1.5.2 embedded into a large C
application, and it runs user-defined scripts.  When a user defined script
goes south, the only way to fix it is to reboot our embedded system. I'd
actually like to do something like

 PyThreadState *tstate;

    tstate = PyThreadState_Get();
    PyThread_Signal( tstate, ABORT);

Anybody know what I mean?

Warren Postma
ZTR Control Systems








More information about the Python-list mailing list