]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix the C function signature for _collections._tuplegetter.__reduce__. (GH-12180)
authorSerhiy Storchaka <storchaka@gmail.com>
Tue, 5 Mar 2019 16:41:09 +0000 (18:41 +0200)
committerGitHub <noreply@github.com>
Tue, 5 Mar 2019 16:41:09 +0000 (18:41 +0200)
Correctly fixes bpo-36197.

Modules/_collectionsmodule.c

index afd2731b8264eec2ec8786bad0d02f1fbdf3f35c..8fb5fc233a656761b226d185cfc8cadc22563c5f 100644 (file)
@@ -2441,7 +2441,7 @@ tuplegetter_dealloc(_tuplegetterobject *self)
 }
 
 static PyObject*
-tuplegetter_reduce(_tuplegetterobject *self)
+tuplegetter_reduce(_tuplegetterobject *self, PyObject *Py_UNUSED(ignored))
 {
     return Py_BuildValue("(O(nO))", (PyObject*) Py_TYPE(self), self->index, self->doc);
 }
@@ -2453,7 +2453,7 @@ static PyMemberDef tuplegetter_members[] = {
 };
 
 static PyMethodDef tuplegetter_methods[] = {
-    {"__reduce__", (PyCFunction)(void(*)(void))tuplegetter_reduce, METH_NOARGS, NULL},
+    {"__reduce__", (PyCFunction)tuplegetter_reduce, METH_NOARGS, NULL},
     {NULL},
 };