On Dec 8, 12:42 pm, Senthil Kumar <[EMAIL PROTECTED]> wrote:
> Hi Pythoneers !
> Can somebody give a quick solution?
> I am trying to raise exceptions in python and trying to handle it in
> C.
> I am able to raise exceptions successfully. However could not catch
> those in C.
> I am using the following function to run the python from C:
> Pyrun_SimpleString().
> After the exception is raised, I am checking PyErr_Occurred(). It
> always returns NULL, and I cannot catch the exception.
> Pls help me a way out.

If a function returns NULL, you can use PyErr_ExceptionMatches to
check if it is the exception you want to catch.
>
> Thanx in advance !

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to