Returning exceptions to C

Mark Hammond mhammond at skippinet.com.au
Thu Mar 23 00:30:37 CET 2000


In article <38d7dd10$0$10825 at wodc7nh7.news.uu.net>,
"Developer" <jonp at bhmi.com> wrote:

> is. The exception is raised in the Python code and the retrun value is
> Py_None. Shouldn't the PyErr_Fetch() caputer the raise exception?
> Here is
> a snip ...
>
> pStr = PyEval_CallObject(pFunc, pArgs);

If this fails, the result is NULL.  And as NULL != Py_None, you are
entering the "success" block.

> if (pStr != Py_None)
> {
ie, this block is entered on failure _and_ success, unless the result
is exactly None.  This block should simply say " ... != NULL"

Mark.


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list