On Dom, 2007-06-10 at 23:26 +0100, Gustavo J. A. M. Carneiro wrote:
> On Dom, 2007-06-10 at 21:46 +0200, Sébastien Granjoux wrote:
> > Hi All,
> > 
> > I'm writing a wrapper for a GInterface derived type, so I have written a 
> > .defs file with something like
> > 
> > (define-virtual activate
> >    (of-object "Plugin")
> >    (c-name "plugin_activate")
> >    (return-type "none")
> > )
> > 
> > 
> > Using codegen I get a function
> > 
> > static void _wrap_Plugin__proxy_do_activate(Plugin *self)
> > {
> >     ...
> >     py_retval = PyObject_CallObject(py_method, py_args);
> >     ...
> >     py_retval = Py_BuildValue("(N)", py_retval);
> >     if (!PyArg_ParseTuple(py_retval, "")) {
> >             if (PyErr_Occurred())
> > 
> > 
> > I don't understand why codegen generates some code to extract the return 
> > value from the python method as the C function doesn't need to return 
> > anything. Moreover, I have an error (not fatal) "TypeError: function 
> > takes exactly 0 arguments (1 given)" in PyArg_ParseTuple which I think 
> > is due to the empty string "".
> > 
> > Is it something wrong in codegen or do I have made an error somewhere ?
> 
>   I think it's a bug in codegen.  A patch (codegen/reversewrapper.py)
> would be most welcome; it just needs to special case where
> PyArg_ParseTuple is called to parse return value if the template string
> is "", then just check for Py_None instead of calling PyArg_ParseTuple.

  Nevermind, I fixed this myself in svn trunk.

-- 
Gustavo J. A. M. Carneiro
<[EMAIL PROTECTED]> <[EMAIL PROTECTED]>
The universe is always one step beyond logic.

_______________________________________________
pygtk mailing list   [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to