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/_tracemalloc.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/_tracemalloc.c.h')
-rw-r--r-- | Modules/clinic/_tracemalloc.c.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/clinic/_tracemalloc.c.h b/Modules/clinic/_tracemalloc.c.h index 2950051..b53fa3e 100644 --- a/Modules/clinic/_tracemalloc.c.h +++ b/Modules/clinic/_tracemalloc.c.h @@ -95,12 +95,12 @@ _tracemalloc_start(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject PyObject *return_value = NULL; Py_ssize_t nframe = 1; - if (!_PyArg_ParseStack(args, nargs, "|n:start", - &nframe)) { + if (!_PyArg_NoStackKeywords("start", kwnames)) { goto exit; } - if (!_PyArg_NoStackKeywords("start", kwnames)) { + if (!_PyArg_ParseStack(args, nargs, "|n:start", + &nframe)) { goto exit; } return_value = _tracemalloc_start_impl(module, nframe); @@ -189,4 +189,4 @@ _tracemalloc_get_traced_memory(PyObject *module, PyObject *Py_UNUSED(ignored)) { return _tracemalloc_get_traced_memory_impl(module); } -/*[clinic end generated code: output=159ce5d627964f09 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ca7b197d1bdcdf27 input=a9049054013a1b77]*/ |