Catching Python exceptions in C

Senthil Kumar senthilkas at
Mon Dec 8 13:42:30 EST 2008

Hi Pythoneers !
Can somebody give a quick solution?
I am trying to raise exceptions in python and trying to handle it in
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:
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.

Thanx in advance !

More information about the Python-list mailing list