Getting the error in embedded python
Boris Ottlewski
Boris.Ottlewski at NOSPAMsystemsoft.de
Mon Mar 13 07:54:38 EST 2000
Ah, I see. Hm, using the low-lovel is something I definetely want to avoid.
Maybe you got an example for me? I just need to run a simple stupid code
that is in a string.
cheerio,
Boris Ottlewski
"Mark Hammond" <mhammond at skippinet.com.au> wrote in message
news:3jVx4.6896$vW.18374 at news-server.bigpond.net.au...
> I believe you will find that PyRun_SimpleString() actually detects the
> error, and calls PyErr_Print(), which clears the error. You may not
> be seeing the traceback as your app does not have a decent stdout
> setup.
>
> You have the Python sources - you can confirm this for yourself.
>
> You probably want to use the lower level calls - PyEval_CallObject
> etc.
>
> Mark.
>
> "Boris Ottlewski" <Boris.Ottlewski at NOSPAMsystemsoft.de> wrote in
> message news:38c7bc91$0$22621 at businessnews.de.uu.net...
> > Hi,
> >
> > I just run a simple script with a syntax error:
> >
> > int res = PyRun_SimpleString("import this_module_does_not exist");
> > if (res!=0)
> > {
> > if (PyErr_Occurred())
> > {
> > file://never happens
> > }
> > }
> >
> > I never get an PyErr_Occured. Also when I do PyErr_Fetch its empty.
> (res
> > is -1 if I got an error).
> >
> > Why is that so? How do I get the error message?
> >
> > regards,
> >
> > Boris Ottlewski
> >
> >
>
>
More information about the Python-list
mailing list