diff options
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 22cde14..91d8440 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, |