[Python-checkins] Fix the C function signature for _collections._tuplegetter.__reduce__. (GH-12180)

Serhiy Storchaka webhook-mailer at python.org
Tue Mar 5 11:41:13 EST 2019


https://github.com/python/cpython/commit/adfffc7343ce7ebc88ec734a803d3247ba8927fb
commit: adfffc7343ce7ebc88ec734a803d3247ba8927fb
branch: master
author: Serhiy Storchaka <storchaka at gmail.com>
committer: GitHub <noreply at github.com>
date: 2019-03-05T18:41:09+02:00
summary:

Fix the C function signature for _collections._tuplegetter.__reduce__. (GH-12180)

Correctly fixes bpo-36197.

files:
M Modules/_collectionsmodule.c

diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c
index afd2731b8264..8fb5fc233a65 100644
--- a/Modules/_collectionsmodule.c
+++ b/Modules/_collectionsmodule.c
@@ -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},
 };
 



More information about the Python-checkins mailing list