diff options
author | 2017-07-03 21:20:15 +0300 | |
---|---|---|
committer | 2017-07-03 21:20:15 +0300 | |
commit | 6969eaf4682beb01bc95eeb14f5ce6c01312e297 (patch) | |
tree | c81a3d9bca3e9d01f557c46a8534a4e3873403f9 /Tools/clinic | |
parent | bpo-30832: Remove own implementation for thread-local storage (#2537) (diff) | |
download | cpython-6969eaf4682beb01bc95eeb14f5ce6c01312e297.tar.gz cpython-6969eaf4682beb01bc95eeb14f5ce6c01312e297.tar.bz2 cpython-6969eaf4682beb01bc95eeb14f5ce6c01312e297.zip |
bpo-29464: Rename METH_FASTCALL to METH_FASTCALL|METH_KEYWORDS and make (#1955)
the bare METH_FASTCALL be used for functions with positional-only
parameters.
Diffstat (limited to 'Tools/clinic')
-rwxr-xr-x | Tools/clinic/clinic.py | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py index 22cde144f37..91d8440e14a 100755 --- a/Tools/clinic/clinic.py +++ b/Tools/clinic/clinic.py @@ -710,6 +710,11 @@ class CLanguage(Language): parser_prototype_fastcall = normalize_snippet(""" static PyObject * + {c_basename}({self_type}{self_name}, PyObject **args, Py_ssize_t nargs) + """) + + parser_prototype_fastcall_keywords = normalize_snippet(""" + static PyObject * {c_basename}({self_type}{self_name}, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) """) @@ -828,10 +833,6 @@ class CLanguage(Language): parser_prototype = parser_prototype_fastcall parser_definition = parser_body(parser_prototype, normalize_snippet(""" - if ({self_type_check}!_PyArg_NoStackKeywords("{name}", kwnames)) {{ - goto exit; - }} - if (!_PyArg_UnpackStack(args, nargs, "{name}", {unpack_min}, {unpack_max}, {parse_arguments})) {{ @@ -859,10 +860,6 @@ class CLanguage(Language): parser_prototype = parser_prototype_fastcall parser_definition = parser_body(parser_prototype, normalize_snippet(""" - if ({self_type_check}!_PyArg_NoStackKeywords("{name}", kwnames)) {{ - goto exit; - }} - if (!_PyArg_ParseStack(args, nargs, "{format_units}:{name}", {parse_arguments})) {{ goto exit; @@ -883,9 +880,9 @@ class CLanguage(Language): """, indent=4)) elif not new_or_init: - flags = "METH_FASTCALL" + flags = "METH_FASTCALL|METH_KEYWORDS" - parser_prototype = parser_prototype_fastcall + parser_prototype = parser_prototype_fastcall_keywords body = normalize_snippet(""" if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser, |