PyArg_ParseTuple exception catching

X

x0rster

Hi,

I'm getting an error when using PyArg_ParseTuple and I don't know
why...In the documentation I've read that PyArg_ParseTuple raise an
appropriate exception :
"on failure, it returns false and raises the appropriate exception."

How can I get the exception in C ? because I've checked the arguments
before calling the C python function and I don't know why I've got a
problem when parsing the arguments list...

Happy new year,
PICA Frédéric
 
F

Fredrik Lundh

I'm getting an error when using PyArg_ParseTuple and I don't know
why...In the documentation I've read that PyArg_ParseTuple raise an
appropriate exception :
"on failure, it returns false and raises the appropriate exception."

How can I get the exception in C ? because I've checked the arguments
before calling the C python function and I don't know why I've got a
problem when parsing the arguments list...

the easiest way to see the exception is to return NULL, and let Python
take care of the rest.

if (!PyArg_ParseTuple(...)):
return NULL;

</F>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top