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/_weakref.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/_weakref.c.h')
-rw-r--r-- | Modules/clinic/_weakref.c.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/clinic/_weakref.c.h b/Modules/clinic/_weakref.c.h index d847867..139a0e1 100644 --- a/Modules/clinic/_weakref.c.h +++ b/Modules/clinic/_weakref.c.h @@ -50,12 +50,12 @@ _weakref__remove_dead_weakref(PyObject *module, PyObject **args, Py_ssize_t narg PyObject *dct; PyObject *key; - if (!_PyArg_ParseStack(args, nargs, "O!O:_remove_dead_weakref", - &PyDict_Type, &dct, &key)) { + if (!_PyArg_NoStackKeywords("_remove_dead_weakref", kwnames)) { goto exit; } - if (!_PyArg_NoStackKeywords("_remove_dead_weakref", kwnames)) { + if (!_PyArg_ParseStack(args, nargs, "O!O:_remove_dead_weakref", + &PyDict_Type, &dct, &key)) { goto exit; } return_value = _weakref__remove_dead_weakref_impl(module, dct, key); @@ -63,4 +63,4 @@ _weakref__remove_dead_weakref(PyObject *module, PyObject **args, Py_ssize_t narg exit: return return_value; } -/*[clinic end generated code: output=b686303486bdfefd input=a9049054013a1b77]*/ +/*[clinic end generated code: output=05ecbb46c85839a2 input=a9049054013a1b77]*/ |