[pygtk] virtual function without a return value

Sébastien Granjoux seb.sfo at free.fr
Mon Jun 11 03:46:58 WST 2007


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 ?

Regards,

Sébastien


More information about the pygtk mailing list