summaryrefslogtreecommitdiff
path: root/Modules/clinic/unicodedata.c.h
diff options
context:
space:
mode:
authorSylvain <sylvain.desodt+github@gmail.com>2017-06-10 06:51:48 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2017-06-10 07:51:48 +0300
commit7445381c606faf20e253da42656db478a4349f8e (patch)
tree49ad79e5347454d1bbfeb1c2d06d3d09fd9b273f /Modules/clinic/unicodedata.c.h
parente5f6e86c48c7b2eb9e1d6a0e72867b4d8b4720f3 (diff)
downloadcpython-git-7445381c606faf20e253da42656db478a4349f8e.tar.gz
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/unicodedata.c.h')
-rw-r--r--Modules/clinic/unicodedata.c.h32
1 files changed, 16 insertions, 16 deletions
diff --git a/Modules/clinic/unicodedata.c.h b/Modules/clinic/unicodedata.c.h
index c3a5910b49..50b1ee27ac 100644
--- a/Modules/clinic/unicodedata.c.h
+++ b/Modules/clinic/unicodedata.c.h
@@ -26,12 +26,12 @@ unicodedata_UCD_decimal(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObj
int chr;
PyObject *default_value = NULL;
- if (!_PyArg_ParseStack(args, nargs, "C|O:decimal",
- &chr, &default_value)) {
+ if (!_PyArg_NoStackKeywords("decimal", kwnames)) {
goto exit;
}
- if (!_PyArg_NoStackKeywords("decimal", kwnames)) {
+ if (!_PyArg_ParseStack(args, nargs, "C|O:decimal",
+ &chr, &default_value)) {
goto exit;
}
return_value = unicodedata_UCD_decimal_impl(self, chr, default_value);
@@ -63,12 +63,12 @@ unicodedata_UCD_digit(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObjec
int chr;
PyObject *default_value = NULL;
- if (!_PyArg_ParseStack(args, nargs, "C|O:digit",
- &chr, &default_value)) {
+ if (!_PyArg_NoStackKeywords("digit", kwnames)) {
goto exit;
}
- if (!_PyArg_NoStackKeywords("digit", kwnames)) {
+ if (!_PyArg_ParseStack(args, nargs, "C|O:digit",
+ &chr, &default_value)) {
goto exit;
}
return_value = unicodedata_UCD_digit_impl(self, chr, default_value);
@@ -101,12 +101,12 @@ unicodedata_UCD_numeric(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObj
int chr;
PyObject *default_value = NULL;
- if (!_PyArg_ParseStack(args, nargs, "C|O:numeric",
- &chr, &default_value)) {
+ if (!_PyArg_NoStackKeywords("numeric", kwnames)) {
goto exit;
}
- if (!_PyArg_NoStackKeywords("numeric", kwnames)) {
+ if (!_PyArg_ParseStack(args, nargs, "C|O:numeric",
+ &chr, &default_value)) {
goto exit;
}
return_value = unicodedata_UCD_numeric_impl(self, chr, default_value);
@@ -318,12 +318,12 @@ unicodedata_UCD_normalize(PyObject *self, PyObject **args, Py_ssize_t nargs, PyO
const char *form;
PyObject *input;
- if (!_PyArg_ParseStack(args, nargs, "sU:normalize",
- &form, &input)) {
+ if (!_PyArg_NoStackKeywords("normalize", kwnames)) {
goto exit;
}
- if (!_PyArg_NoStackKeywords("normalize", kwnames)) {
+ if (!_PyArg_ParseStack(args, nargs, "sU:normalize",
+ &form, &input)) {
goto exit;
}
return_value = unicodedata_UCD_normalize_impl(self, form, input);
@@ -354,12 +354,12 @@ unicodedata_UCD_name(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject
int chr;
PyObject *default_value = NULL;
- if (!_PyArg_ParseStack(args, nargs, "C|O:name",
- &chr, &default_value)) {
+ if (!_PyArg_NoStackKeywords("name", kwnames)) {
goto exit;
}
- if (!_PyArg_NoStackKeywords("name", kwnames)) {
+ if (!_PyArg_ParseStack(args, nargs, "C|O:name",
+ &chr, &default_value)) {
goto exit;
}
return_value = unicodedata_UCD_name_impl(self, chr, default_value);
@@ -399,4 +399,4 @@ unicodedata_UCD_lookup(PyObject *self, PyObject *arg)
exit:
return return_value;
}
-/*[clinic end generated code: output=fcb86aaa3fa40876 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=f69c0bbd7294870b input=a9049054013a1b77]*/