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/_opcode.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/_opcode.c.h')
-rw-r--r-- | Modules/clinic/_opcode.c.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/clinic/_opcode.c.h b/Modules/clinic/_opcode.c.h index 77f31d9..2f5fd0d 100644 --- a/Modules/clinic/_opcode.c.h +++ b/Modules/clinic/_opcode.c.h @@ -22,12 +22,12 @@ _opcode_stack_effect(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObje PyObject *oparg = Py_None; int _return_value; - if (!_PyArg_ParseStack(args, nargs, "i|O:stack_effect", - &opcode, &oparg)) { + if (!_PyArg_NoStackKeywords("stack_effect", kwnames)) { goto exit; } - if (!_PyArg_NoStackKeywords("stack_effect", kwnames)) { + if (!_PyArg_ParseStack(args, nargs, "i|O:stack_effect", + &opcode, &oparg)) { goto exit; } _return_value = _opcode_stack_effect_impl(module, opcode, oparg); @@ -39,4 +39,4 @@ _opcode_stack_effect(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObje exit: return return_value; } -/*[clinic end generated code: output=62858005ac85baa9 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=38f3bf305b3bb601 input=a9049054013a1b77]*/ |