Home

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

previous
next

String Constant absent in C++
Re: Forward Declaration produces an error (no cyclic dependencies tho)
Re: Class diagrams
Re: Regular Expressions: Can't quite figure this problem out
Re: Would Anonymous Functions Help in Learning Programming/Python?
Pajacyk
Rodzic Po Ludzku
Fundacja Iskierka
Dzieci Niczyje
Krwinka