Embedding - getting full error string

Elie Babila elibabila at hotmail.com
Mon Feb 9 14:50:20 CET 2004


Thank you for your answer. I've added the lines you specified, and it fixed 
my problem.
Thanks again.

Elie

>From: Paul Miller <paul at fxtech.com>
>To: elibabila at hotmail.com (Elie B.), python-list at python.org
>Subject: Re: Embedding - getting full error string
>Date: Sun, 08 Feb 2004 09:51:27 -0600
>
>
>>static PyObject *mymodule_printit(PyObject *self, PyObject* args)
>>{
>>         char *s;
>>         PyArg_ParseTuple(args, "s", &s);
>>         PrintToWindow(s); <-- my function
>>         return NULL;
>>}
>
>One problem is technically you're returning an error from your print 
>function. You need to return an increfed PyNone:
>
>         Py_INCREF(Py_None);
>         return Py_None;
>
>Otherwise your code looks pretty much like mine does, and it works fine.
>
>
>

_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online 
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963





More information about the Python-list mailing list