Issue #15422: get rid of PyCFunction_New macro

This commit is contained in:
Andrew Svetlov 2012-12-25 13:32:35 +02:00
parent 914ab8420e
commit 3ba3a3ee56
9 changed files with 20 additions and 23 deletions

View file

@ -13,6 +13,12 @@ static int numfree = 0;
#define PyCFunction_MAXFREELIST 256
#endif
PyObject *
PyCFunction_New(PyMethodDef *ml, PyObject *self)
{
return PyCFunction_NewEx(ml, self, NULL);
}
PyObject *
PyCFunction_NewEx(PyMethodDef *ml, PyObject *self, PyObject *module)
{
@ -346,17 +352,3 @@ _PyCFunction_DebugMallocStats(FILE *out)
"free PyCFunction",
numfree, sizeof(PyCFunction));
}
/* PyCFunction_New() is now just a macro that calls PyCFunction_NewEx(),
but it's part of the API so we need to keep a function around that
existing C extensions can call.
*/
#undef PyCFunction_New
PyAPI_FUNC(PyObject *) PyCFunction_New(PyMethodDef *, PyObject *);
PyObject *
PyCFunction_New(PyMethodDef *ml, PyObject *self)
{
return PyCFunction_NewEx(ml, self, NULL);
}