summaryrefslogtreecommitdiffstats
path: root/Tools/clinic
diff options
context:
space:
mode:
authorLarry Hastings <larry@hastings.org>2014-01-04 19:09:09 (GMT)
committerLarry Hastings <larry@hastings.org>2014-01-04 19:09:09 (GMT)
commit3cceb384861eeae1f164568a9ea30534fdf2c87c (patch)
treee46cf8291ab3f31367845b16b169ea8feed5c0a0 /Tools/clinic
parent583a93943c0f090ac2699d7feb33e72bfed7323e (diff)
downloadcpython-3cceb384861eeae1f164568a9ea30534fdf2c87c.zip
cpython-3cceb384861eeae1f164568a9ea30534fdf2c87c.tar.gz
cpython-3cceb384861eeae1f164568a9ea30534fdf2c87c.tar.bz2
Issue #19976: Argument Clinic METH_NOARGS functions now always
take two parameters.
Diffstat (limited to 'Tools/clinic')
-rwxr-xr-xTools/clinic/clinic.py13
1 files changed, 2 insertions, 11 deletions
diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py
index c332b0c..7dd6215 100755
--- a/Tools/clinic/clinic.py
+++ b/Tools/clinic/clinic.py
@@ -400,19 +400,13 @@ PyDoc_STRVAR({c_basename}__doc__,
{{"{name}", (PyCFunction){c_basename}, {methoddef_flags}, {c_basename}__doc__}},
""".replace('{methoddef_flags}', flags)
- def meth_noargs_pyobject_template(self, methoddef_flags=""):
- return self.template_base("METH_NOARGS", methoddef_flags) + """
-static PyObject *
-{c_basename}({impl_parameters})
-"""
-
def meth_noargs_template(self, methoddef_flags=""):
return self.template_base("METH_NOARGS", methoddef_flags) + """
static {impl_return_type}
{impl_prototype};
static PyObject *
-{c_basename}({self_type}{self_name})
+{c_basename}({self_type}{self_name}, PyObject *Py_UNUSED(ignored))
{{
PyObject *return_value = NULL;
{declarations}
@@ -713,10 +707,7 @@ static {impl_return_type}
f.return_converter.type == 'PyObject *')
if not parameters:
- if default_return_converter:
- template = self.meth_noargs_pyobject_template(f.methoddef_flags)
- else:
- template = self.meth_noargs_template(f.methoddef_flags)
+ template = self.meth_noargs_template(f.methoddef_flags)
elif (len(parameters) == 1 and
parameters[0].kind == inspect.Parameter.POSITIONAL_ONLY and
not converters[0].is_optional() and