Index: Include/methodobject.h =================================================================== --- a/Include/methodobject.h +++ b/Include/methodobject.h @@ -46,9 +46,12 @@ }; typedef struct PyMethodDef PyMethodDef; -#define PyCFunction_New(ML, SELF) PyCFunction_NewEx((ML), (SELF), NULL) -PyAPI_FUNC(PyObject *) PyCFunction_NewEx(PyMethodDef *, PyObject *, - PyObject *); +#define PyCFunction_New(ML, SELF) \ + PyCFunction_NewExEx((ML), (SELF), NULL, NULL) +#define PyCFunction_NewEx(ML, SELF, MODULE) \ + PyCFunction_NewExEx((ML), (SELF), (MODULE), NULL) +PyAPI_FUNC(PyObject *) PyCFunction_NewExEx(PyMethodDef *, PyObject *, + PyObject *, PyObject *); /* Flag passed to newmethodobject */ /* #define METH_OLDARGS 0x0000 -- unsupported now */ @@ -77,6 +80,7 @@ PyMethodDef *m_ml; /* Description of the C function to call */ PyObject *m_self; /* Passed as 'self' arg to the C func, can be NULL */ PyObject *m_module; /* The __module__ attribute, can be anything */ + PyObject *m_unbound; } PyCFunctionObject; #endif