diff options
author | Erlend E. Aasland <erlend@python.org> | 2024-02-05 20:49:17 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-05 20:49:17 (GMT) |
commit | 09096a1647913526a3d4fa69a9d2056ec82a8f37 (patch) | |
tree | 906760eb46b791e15777b34a2a8bd21399ab5b27 /Modules/clinic/_testmultiphase.c.h | |
parent | 4aa4f0906df9fc9c6c6f6657f2c521468c6b1688 (diff) | |
download | cpython-09096a1647913526a3d4fa69a9d2056ec82a8f37.zip cpython-09096a1647913526a3d4fa69a9d2056ec82a8f37.tar.gz cpython-09096a1647913526a3d4fa69a9d2056ec82a8f37.tar.bz2 |
gh-115015: Argument Clinic: fix generated code for METH_METHOD methods without params (#115016)
Diffstat (limited to 'Modules/clinic/_testmultiphase.c.h')
-rw-r--r-- | Modules/clinic/_testmultiphase.c.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/clinic/_testmultiphase.c.h b/Modules/clinic/_testmultiphase.c.h index c0a0095..7ac361e 100644 --- a/Modules/clinic/_testmultiphase.c.h +++ b/Modules/clinic/_testmultiphase.c.h @@ -27,7 +27,7 @@ _testmultiphase_StateAccessType_get_defining_module_impl(StateAccessTypeObject * static PyObject * _testmultiphase_StateAccessType_get_defining_module(StateAccessTypeObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { - if (nargs) { + if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "get_defining_module() takes no arguments"); return NULL; } @@ -50,7 +50,7 @@ _testmultiphase_StateAccessType_getmodulebydef_bad_def_impl(StateAccessTypeObjec static PyObject * _testmultiphase_StateAccessType_getmodulebydef_bad_def(StateAccessTypeObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { - if (nargs) { + if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "getmodulebydef_bad_def() takes no arguments"); return NULL; } @@ -156,10 +156,10 @@ _testmultiphase_StateAccessType_get_count_impl(StateAccessTypeObject *self, static PyObject * _testmultiphase_StateAccessType_get_count(StateAccessTypeObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { - if (nargs) { + if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) { PyErr_SetString(PyExc_TypeError, "get_count() takes no arguments"); return NULL; } return _testmultiphase_StateAccessType_get_count_impl(self, cls); } -/*[clinic end generated code: output=d8c262af27b3b98d input=a9049054013a1b77]*/ +/*[clinic end generated code: output=2c199bad52e9cda7 input=a9049054013a1b77]*/ |