summaryrefslogtreecommitdiffstats
path: root/Modules/clinic/_lzmamodule.c.h
diff options
context:
space:
mode:
authorSylvain <sylvain.desodt+github@gmail.com>2017-06-10 04:51:48 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2017-06-10 04:51:48 (GMT)
commit7445381c606faf20e253da42656db478a4349f8e (patch)
tree49ad79e5347454d1bbfeb1c2d06d3d09fd9b273f /Modules/clinic/_lzmamodule.c.h
parente5f6e86c48c7b2eb9e1d6a0e72867b4d8b4720f3 (diff)
downloadcpython-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/_lzmamodule.c.h')
-rw-r--r--Modules/clinic/_lzmamodule.c.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/clinic/_lzmamodule.c.h b/Modules/clinic/_lzmamodule.c.h
index a3b1ad5..33e357b 100644
--- a/Modules/clinic/_lzmamodule.c.h
+++ b/Modules/clinic/_lzmamodule.c.h
@@ -242,12 +242,12 @@ _lzma__decode_filter_properties(PyObject *module, PyObject **args, Py_ssize_t na
lzma_vli filter_id;
Py_buffer encoded_props = {NULL, NULL};
- if (!_PyArg_ParseStack(args, nargs, "O&y*:_decode_filter_properties",
- lzma_vli_converter, &filter_id, &encoded_props)) {
+ if (!_PyArg_NoStackKeywords("_decode_filter_properties", kwnames)) {
goto exit;
}
- if (!_PyArg_NoStackKeywords("_decode_filter_properties", kwnames)) {
+ if (!_PyArg_ParseStack(args, nargs, "O&y*:_decode_filter_properties",
+ lzma_vli_converter, &filter_id, &encoded_props)) {
goto exit;
}
return_value = _lzma__decode_filter_properties_impl(module, filter_id, &encoded_props);
@@ -260,4 +260,4 @@ exit:
return return_value;
}
-/*[clinic end generated code: output=5f7a915fb7e41453 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=473cf89eb501c28b input=a9049054013a1b77]*/