On Thu, 02 Aug, Farshid Lashkari wrote: > Also, here is some sample code that will catch system exit exceptions: > > //Call python code > ... > //Check for system exit exception > if(PyErr_Occurred()) { > if(PyErr_ExceptionMatches(PyExc_SystemExit)) { > //handle system exit > PyErr_Clear(); > } else { > PyErr_Print(); > } > }
Thanks for your hints ... The interesting part is "Call python code". In my example this is done with PyRun_SimpleString which does not return if an exception is not handled but raised "out of" the interpreter. So I am unsure of what you mean with "Call python code". When installing an excepthook (see my other posting), then I can indeed catch all exceptions ... except for SystemExit which is the one I'm after. -- Stefan Bellon -- http://mail.python.org/mailman/listinfo/python-list