469,270 Members | 1,151 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,270 developers. It's quick & easy.

PyArg_ParseTuple exception catching

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

Dec 26 '05 #1
1 2128
x0*****@gmail.com wrote:
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>

Dec 26 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Torsten Mohr | last post: by
4 posts views Thread by sjh | last post: by
11 posts views Thread by Master of C++ | last post: by
7 posts views Thread by cmay | last post: by
132 posts views Thread by Zorro | last post: by
4 posts views Thread by Terry Olsen | last post: by
35 posts views Thread by eliben | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.