Embedded Python and C Callback functions

dieter dieter at handshake.de
Mon Jun 8 01:44:52 EDT 2015


doc.mefisto at gmail.com writes:

> I'm trying to debug and find my error. It goes wrong when:
>  PyObject *v;
>             v = va_arg(*p_va, PyObject *);
>             if (v != NULL) {
>                 if (*(*p_format - 1) != 'N')
>                     Py_INCREF(v);
>             }
>
> it tries to PyINCREF to my passed callback.

This indicates that it expects the "callback" to be a Python object.

Check the C-API specification. It should tell you which parameters
are expected to be Python objects and which C objects.




More information about the Python-list mailing list