diff options
author | Sylvain <sylvain.desodt+github@gmail.com> | 2017-06-10 04:51:48 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2017-06-10 04:51:48 (GMT) |
commit | 7445381c606faf20e253da42656db478a4349f8e (patch) | |
tree | 49ad79e5347454d1bbfeb1c2d06d3d09fd9b273f /Modules/clinic/_tkinter.c.h | |
parent | e5f6e86c48c7b2eb9e1d6a0e72867b4d8b4720f3 (diff) | |
download | cpython-7445381c606faf20e253da42656db478a4349f8e.zip cpython-7445381c606faf20e253da42656db478a4349f8e.tar.gz cpython-7445381c606faf20e253da42656db478a4349f8e.tar.bz2 |
bpo-30600: Fix error messages (condition order in Argument Clinic) (#2051)
The function '_PyArg_ParseStack()' and
'_PyArg_UnpackStack' were failing (with error
"XXX() takes Y argument (Z given)") before
the function '_PyArg_NoStackKeywords()' was called.
Thus, the latter did not raise its more meaningful
error : "XXX() takes no keyword arguments".
Diffstat (limited to 'Modules/clinic/_tkinter.c.h')
-rw-r--r-- | Modules/clinic/_tkinter.c.h | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/Modules/clinic/_tkinter.c.h b/Modules/clinic/_tkinter.c.h index 5d75ec3..fde92c0 100644 --- a/Modules/clinic/_tkinter.c.h +++ b/Modules/clinic/_tkinter.c.h @@ -269,12 +269,12 @@ _tkinter_tkapp_createcommand(TkappObject *self, PyObject **args, Py_ssize_t narg const char *name; PyObject *func; - if (!_PyArg_ParseStack(args, nargs, "sO:createcommand", - &name, &func)) { + if (!_PyArg_NoStackKeywords("createcommand", kwnames)) { goto exit; } - if (!_PyArg_NoStackKeywords("createcommand", kwnames)) { + if (!_PyArg_ParseStack(args, nargs, "sO:createcommand", + &name, &func)) { goto exit; } return_value = _tkinter_tkapp_createcommand_impl(self, name, func); @@ -331,12 +331,12 @@ _tkinter_tkapp_createfilehandler(TkappObject *self, PyObject **args, Py_ssize_t int mask; PyObject *func; - if (!_PyArg_ParseStack(args, nargs, "OiO:createfilehandler", - &file, &mask, &func)) { + if (!_PyArg_NoStackKeywords("createfilehandler", kwnames)) { goto exit; } - if (!_PyArg_NoStackKeywords("createfilehandler", kwnames)) { + if (!_PyArg_ParseStack(args, nargs, "OiO:createfilehandler", + &file, &mask, &func)) { goto exit; } return_value = _tkinter_tkapp_createfilehandler_impl(self, file, mask, func); @@ -395,12 +395,12 @@ _tkinter_tkapp_createtimerhandler(TkappObject *self, PyObject **args, Py_ssize_t int milliseconds; PyObject *func; - if (!_PyArg_ParseStack(args, nargs, "iO:createtimerhandler", - &milliseconds, &func)) { + if (!_PyArg_NoStackKeywords("createtimerhandler", kwnames)) { goto exit; } - if (!_PyArg_NoStackKeywords("createtimerhandler", kwnames)) { + if (!_PyArg_ParseStack(args, nargs, "iO:createtimerhandler", + &milliseconds, &func)) { goto exit; } return_value = _tkinter_tkapp_createtimerhandler_impl(self, milliseconds, func); @@ -426,12 +426,12 @@ _tkinter_tkapp_mainloop(TkappObject *self, PyObject **args, Py_ssize_t nargs, Py PyObject *return_value = NULL; int threshold = 0; - if (!_PyArg_ParseStack(args, nargs, "|i:mainloop", - &threshold)) { + if (!_PyArg_NoStackKeywords("mainloop", kwnames)) { goto exit; } - if (!_PyArg_NoStackKeywords("mainloop", kwnames)) { + if (!_PyArg_ParseStack(args, nargs, "|i:mainloop", + &threshold)) { goto exit; } return_value = _tkinter_tkapp_mainloop_impl(self, threshold); @@ -457,12 +457,12 @@ _tkinter_tkapp_dooneevent(TkappObject *self, PyObject **args, Py_ssize_t nargs, PyObject *return_value = NULL; int flags = 0; - if (!_PyArg_ParseStack(args, nargs, "|i:dooneevent", - &flags)) { + if (!_PyArg_NoStackKeywords("dooneevent", kwnames)) { goto exit; } - if (!_PyArg_NoStackKeywords("dooneevent", kwnames)) { + if (!_PyArg_ParseStack(args, nargs, "|i:dooneevent", + &flags)) { goto exit; } return_value = _tkinter_tkapp_dooneevent_impl(self, flags); @@ -584,12 +584,12 @@ _tkinter_create(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *k int sync = 0; const char *use = NULL; - if (!_PyArg_ParseStack(args, nargs, "|zssiiiiz:create", - &screenName, &baseName, &className, &interactive, &wantobjects, &wantTk, &sync, &use)) { + if (!_PyArg_NoStackKeywords("create", kwnames)) { goto exit; } - if (!_PyArg_NoStackKeywords("create", kwnames)) { + if (!_PyArg_ParseStack(args, nargs, "|zssiiiiz:create", + &screenName, &baseName, &className, &interactive, &wantobjects, &wantTk, &sync, &use)) { goto exit; } return_value = _tkinter_create_impl(module, screenName, baseName, className, interactive, wantobjects, wantTk, sync, use); @@ -662,4 +662,4 @@ exit: #ifndef _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF #define _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF #endif /* !defined(_TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF) */ -/*[clinic end generated code: output=328e29a146c4a63b input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ed14e0bb0cd9c8e0 input=a9049054013a1b77]*/ |