Problems sending list/tuple to a C extension.

Martin v. Löwis martin at v.loewis.de
Mon Nov 24 17:37:55 EST 2003


seberino at spawar.navy.mil (Christian Seberino) writes:

> I think you misunderstood my question.  My invocation of PyArg_ParseTuple
> was flawless EXCEPT for checking return value.
> 
> ALL I did was check return value and then code worked fine!!!
> 
> *This* is what was exceedingly strange.

When you say "It worked fine", you mean "It raises an exception", right?
Because you did not, actually, pass a tuple to the call.

If you had passed a tuple to the call, instead of passing an integer,
it would have worked even without the check for an error return. It
was only because you made an error *in Python* that the failure to
check for errors in C made any difference.

Or are you asking "Why do I need to check for errors in Python code if
the Python code does have errors?" I couldn't quite imagine why you
would ask this question: How else could Python possibly communicate
the error to the Python code, except by returning an error????

Regards,
Martin





More information about the Python-list mailing list