summaryrefslogtreecommitdiff
path: root/Objects/clinic
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 /Objects/clinic
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 'Objects/clinic')
-rw-r--r--Objects/clinic/bytearrayobject.c.h56
-rw-r--r--Objects/clinic/bytesobject.c.h38
-rw-r--r--Objects/clinic/dictobject.c.h26
-rw-r--r--Objects/clinic/floatobject.c.h16
-rw-r--r--Objects/clinic/listobject.c.h20
-rw-r--r--Objects/clinic/tupleobject.c.h8
-rw-r--r--Objects/clinic/unicodeobject.c.h56
7 files changed, 110 insertions, 110 deletions
diff --git a/Objects/clinic/bytearrayobject.c.h b/Objects/clinic/bytearrayobject.c.h
index a181d9a99b..8363dbdd8e 100644
--- a/Objects/clinic/bytearrayobject.c.h
+++ b/Objects/clinic/bytearrayobject.c.h
@@ -100,12 +100,12 @@ bytearray_maketrans(void *null, PyObject **args, Py_ssize_t nargs, PyObject *kwn
Py_buffer frm = {NULL, NULL};
Py_buffer to = {NULL, NULL};
- if (!_PyArg_ParseStack(args, nargs, "y*y*:maketrans",
- &frm, &to)) {
+ if (!_PyArg_NoStackKeywords("maketrans", kwnames)) {
goto exit;
}
- if (!_PyArg_NoStackKeywords("maketrans", kwnames)) {
+ if (!_PyArg_ParseStack(args, nargs, "y*y*:maketrans",
+ &frm, &to)) {
goto exit;
}
return_value = bytearray_maketrans_impl(&frm, &to);
@@ -151,12 +151,12 @@ bytearray_replace(PyByteArrayObject *self, PyObject **args, Py_ssize_t nargs, Py
Py_buffer new = {NULL, NULL};
Py_ssize_t count = -1;
- if (!_PyArg_ParseStack(args, nargs, "y*y*|n:replace",
- &old, &new, &count)) {
+ if (!_PyArg_NoStackKeywords("replace", kwnames)) {
goto exit;
}
- if (!_PyArg_NoStackKeywords("replace", kwnames)) {
+ if (!_PyArg_ParseStack(args, nargs, "y*y*|n:replace",
+ &old, &new, &count)) {
goto exit;
}
return_value = bytearray_replace_impl(self, &old, &new, count);
@@ -330,12 +330,12 @@ bytearray_insert(PyByteArrayObject *self, PyObject **args, Py_ssize_t nargs, PyO
Py_ssize_t index;
int item;
- if (!_PyArg_ParseStack(args, nargs, "nO&:insert",
- &index, _getbytevalue, &item)) {
+ if (!_PyArg_NoStackKeywords("insert", kwnames)) {
goto exit;
}
- if (!_PyArg_NoStackKeywords("insert", kwnames)) {
+ if (!_PyArg_ParseStack(args, nargs, "nO&:insert",
+ &index, _getbytevalue, &item)) {
goto exit;
}
return_value = bytearray_insert_impl(self, index, item);
@@ -410,12 +410,12 @@ bytearray_pop(PyByteArrayObject *self, PyObject **args, Py_ssize_t nargs, PyObje
PyObject *return_value = NULL;
Py_ssize_t index = -1;
- if (!_PyArg_ParseStack(args, nargs, "|n:pop",
- &index)) {
+ if (!_PyArg_NoStackKeywords("pop", kwnames)) {
goto exit;
}
- if (!_PyArg_NoStackKeywords("pop", kwnames)) {
+ if (!_PyArg_ParseStack(args, nargs, "|n:pop",
+ &index)) {
goto exit;
}
return_value = bytearray_pop_impl(self, index);
@@ -474,13 +474,13 @@ bytearray_strip(PyByteArrayObject *self, PyObject **args, Py_ssize_t nargs, PyOb
PyObject *return_value = NULL;
PyObject *bytes = Py_None;
- if (!_PyArg_UnpackStack(args, nargs, "strip",
- 0, 1,
- &bytes)) {
+ if (!_PyArg_NoStackKeywords("strip", kwnames)) {
goto exit;
}
- if (!_PyArg_NoStackKeywords("strip", kwnames)) {
+ if (!_PyArg_UnpackStack(args, nargs, "strip",
+ 0, 1,
+ &bytes)) {
goto exit;
}
return_value = bytearray_strip_impl(self, bytes);
@@ -509,13 +509,13 @@ bytearray_lstrip(PyByteArrayObject *self, PyObject **args, Py_ssize_t nargs, PyO
PyObject *return_value = NULL;
PyObject *bytes = Py_None;
- if (!_PyArg_UnpackStack(args, nargs, "lstrip",
- 0, 1,
- &bytes)) {
+ if (!_PyArg_NoStackKeywords("lstrip", kwnames)) {
goto exit;
}
- if (!_PyArg_NoStackKeywords("lstrip", kwnames)) {
+ if (!_PyArg_UnpackStack(args, nargs, "lstrip",
+ 0, 1,
+ &bytes)) {
goto exit;
}
return_value = bytearray_lstrip_impl(self, bytes);
@@ -544,13 +544,13 @@ bytearray_rstrip(PyByteArrayObject *self, PyObject **args, Py_ssize_t nargs, PyO
PyObject *return_value = NULL;
PyObject *bytes = Py_None;
- if (!_PyArg_UnpackStack(args, nargs, "rstrip",
- 0, 1,
- &bytes)) {
+ if (!_PyArg_NoStackKeywords("rstrip", kwnames)) {
goto exit;
}
- if (!_PyArg_NoStackKeywords("rstrip", kwnames)) {
+ if (!_PyArg_UnpackStack(args, nargs, "rstrip",
+ 0, 1,
+ &bytes)) {
goto exit;
}
return_value = bytearray_rstrip_impl(self, bytes);
@@ -712,12 +712,12 @@ bytearray_reduce_ex(PyByteArrayObject *self, PyObject **args, Py_ssize_t nargs,
PyObject *return_value = NULL;
int proto = 0;
- if (!_PyArg_ParseStack(args, nargs, "|i:__reduce_ex__",
- &proto)) {
+ if (!_PyArg_NoStackKeywords("__reduce_ex__", kwnames)) {
goto exit;
}
- if (!_PyArg_NoStackKeywords("__reduce_ex__", kwnames)) {
+ if (!_PyArg_ParseStack(args, nargs, "|i:__reduce_ex__",
+ &proto)) {
goto exit;
}
return_value = bytearray_reduce_ex_impl(self, proto);
@@ -743,4 +743,4 @@ bytearray_sizeof(PyByteArrayObject *self, PyObject *Py_UNUSED(ignored))
{
return bytearray_sizeof_impl(self);
}
-/*[clinic end generated code: output=f5c364927425fae8 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=f0079d8ee82614f7 input=a9049054013a1b77]*/
diff --git a/Objects/clinic/bytesobject.c.h b/Objects/clinic/bytesobject.c.h
index c73b56023d..da17cf8c3c 100644
--- a/Objects/clinic/bytesobject.c.h
+++ b/Objects/clinic/bytesobject.c.h
@@ -195,13 +195,13 @@ bytes_strip(PyBytesObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kw
PyObject *return_value = NULL;
PyObject *bytes = Py_None;
- if (!_PyArg_UnpackStack(args, nargs, "strip",
- 0, 1,
- &bytes)) {
+ if (!_PyArg_NoStackKeywords("strip", kwnames)) {
goto exit;
}
- if (!_PyArg_NoStackKeywords("strip", kwnames)) {
+ if (!_PyArg_UnpackStack(args, nargs, "strip",
+ 0, 1,
+ &bytes)) {
goto exit;
}
return_value = bytes_strip_impl(self, bytes);
@@ -230,13 +230,13 @@ bytes_lstrip(PyBytesObject *self, PyObject **args, Py_ssize_t nargs, PyObject *k
PyObject *return_value = NULL;
PyObject *bytes = Py_None;
- if (!_PyArg_UnpackStack(args, nargs, "lstrip",
- 0, 1,
- &bytes)) {
+ if (!_PyArg_NoStackKeywords("lstrip", kwnames)) {
goto exit;
}
- if (!_PyArg_NoStackKeywords("lstrip", kwnames)) {
+ if (!_PyArg_UnpackStack(args, nargs, "lstrip",
+ 0, 1,
+ &bytes)) {
goto exit;
}
return_value = bytes_lstrip_impl(self, bytes);
@@ -265,13 +265,13 @@ bytes_rstrip(PyBytesObject *self, PyObject **args, Py_ssize_t nargs, PyObject *k
PyObject *return_value = NULL;
PyObject *bytes = Py_None;
- if (!_PyArg_UnpackStack(args, nargs, "rstrip",
- 0, 1,
- &bytes)) {
+ if (!_PyArg_NoStackKeywords("rstrip", kwnames)) {
goto exit;
}
- if (!_PyArg_NoStackKeywords("rstrip", kwnames)) {
+ if (!_PyArg_UnpackStack(args, nargs, "rstrip",
+ 0, 1,
+ &bytes)) {
goto exit;
}
return_value = bytes_rstrip_impl(self, bytes);
@@ -342,12 +342,12 @@ bytes_maketrans(void *null, PyObject **args, Py_ssize_t nargs, PyObject *kwnames
Py_buffer frm = {NULL, NULL};
Py_buffer to = {NULL, NULL};
- if (!_PyArg_ParseStack(args, nargs, "y*y*:maketrans",
- &frm, &to)) {
+ if (!_PyArg_NoStackKeywords("maketrans", kwnames)) {
goto exit;
}
- if (!_PyArg_NoStackKeywords("maketrans", kwnames)) {
+ if (!_PyArg_ParseStack(args, nargs, "y*y*:maketrans",
+ &frm, &to)) {
goto exit;
}
return_value = bytes_maketrans_impl(&frm, &to);
@@ -393,12 +393,12 @@ bytes_replace(PyBytesObject *self, PyObject **args, Py_ssize_t nargs, PyObject *
Py_buffer new = {NULL, NULL};
Py_ssize_t count = -1;
- if (!_PyArg_ParseStack(args, nargs, "y*y*|n:replace",
- &old, &new, &count)) {
+ if (!_PyArg_NoStackKeywords("replace", kwnames)) {
goto exit;
}
- if (!_PyArg_NoStackKeywords("replace", kwnames)) {
+ if (!_PyArg_ParseStack(args, nargs, "y*y*|n:replace",
+ &old, &new, &count)) {
goto exit;
}
return_value = bytes_replace_impl(self, &old, &new, count);
@@ -519,4 +519,4 @@ bytes_fromhex(PyTypeObject *type, PyObject *arg)
exit:
return return_value;
}
-/*[clinic end generated code: output=2504c1225108d348 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=a82999760469bbec input=a9049054013a1b77]*/
diff --git a/Objects/clinic/dictobject.c.h b/Objects/clinic/dictobject.c.h
index fb1e797de1..2e11cd2705 100644
--- a/Objects/clinic/dictobject.c.h
+++ b/Objects/clinic/dictobject.c.h
@@ -21,13 +21,13 @@ dict_fromkeys(PyTypeObject *type, PyObject **args, Py_ssize_t nargs, PyObject *k
PyObject *iterable;
PyObject *value = Py_None;
- if (!_PyArg_UnpackStack(args, nargs, "fromkeys",
- 1, 2,
- &iterable, &value)) {
+ if (!_PyArg_NoStackKeywords("fromkeys", kwnames)) {
goto exit;
}
- if (!_PyArg_NoStackKeywords("fromkeys", kwnames)) {
+ if (!_PyArg_UnpackStack(args, nargs, "fromkeys",
+ 1, 2,
+ &iterable, &value)) {
goto exit;
}
return_value = dict_fromkeys_impl(type, iterable, value);
@@ -64,13 +64,13 @@ dict_get(PyDictObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwname
PyObject *key;
PyObject *default_value = Py_None;
- if (!_PyArg_UnpackStack(args, nargs, "get",
- 1, 2,
- &key, &default_value)) {
+ if (!_PyArg_NoStackKeywords("get", kwnames)) {
goto exit;
}
- if (!_PyArg_NoStackKeywords("get", kwnames)) {
+ if (!_PyArg_UnpackStack(args, nargs, "get",
+ 1, 2,
+ &key, &default_value)) {
goto exit;
}
return_value = dict_get_impl(self, key, default_value);
@@ -101,13 +101,13 @@ dict_setdefault(PyDictObject *self, PyObject **args, Py_ssize_t nargs, PyObject
PyObject *key;
PyObject *default_value = Py_None;
- if (!_PyArg_UnpackStack(args, nargs, "setdefault",
- 1, 2,
- &key, &default_value)) {
+ if (!_PyArg_NoStackKeywords("setdefault", kwnames)) {
goto exit;
}
- if (!_PyArg_NoStackKeywords("setdefault", kwnames)) {
+ if (!_PyArg_UnpackStack(args, nargs, "setdefault",
+ 1, 2,
+ &key, &default_value)) {
goto exit;
}
return_value = dict_setdefault_impl(self, key, default_value);
@@ -115,4 +115,4 @@ dict_setdefault(PyDictObject *self, PyObject **args, Py_ssize_t nargs, PyObject
exit:
return return_value;
}
-/*[clinic end generated code: output=4d57df133cf66e53 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=49e03ab4360f5be0 input=a9049054013a1b77]*/
diff --git a/Objects/clinic/floatobject.c.h b/Objects/clinic/floatobject.c.h
index d9ac39dd35..893629bda6 100644
--- a/Objects/clinic/floatobject.c.h
+++ b/Objects/clinic/floatobject.c.h
@@ -58,13 +58,13 @@ float___round__(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwn
PyObject *return_value = NULL;
PyObject *o_ndigits = NULL;
- if (!_PyArg_UnpackStack(args, nargs, "__round__",
- 0, 1,
- &o_ndigits)) {
+ if (!_PyArg_NoStackKeywords("__round__", kwnames)) {
goto exit;
}
- if (!_PyArg_NoStackKeywords("__round__", kwnames)) {
+ if (!_PyArg_UnpackStack(args, nargs, "__round__",
+ 0, 1,
+ &o_ndigits)) {
goto exit;
}
return_value = float___round___impl(self, o_ndigits);
@@ -273,12 +273,12 @@ float___set_format__(PyTypeObject *type, PyObject **args, Py_ssize_t nargs, PyOb
const char *typestr;
const char *fmt;
- if (!_PyArg_ParseStack(args, nargs, "ss:__set_format__",
- &typestr, &fmt)) {
+ if (!_PyArg_NoStackKeywords("__set_format__", kwnames)) {
goto exit;
}
- if (!_PyArg_NoStackKeywords("__set_format__", kwnames)) {
+ if (!_PyArg_ParseStack(args, nargs, "ss:__set_format__",
+ &typestr, &fmt)) {
goto exit;
}
return_value = float___set_format___impl(type, typestr, fmt);
@@ -313,4 +313,4 @@ float___format__(PyObject *self, PyObject *arg)
exit:
return return_value;
}
-/*[clinic end generated code: output=dc6b0b67a7e40c93 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=b2271e7413b36162 input=a9049054013a1b77]*/
diff --git a/Objects/clinic/listobject.c.h b/Objects/clinic/listobject.c.h
index 43d5599d7a..d5b9b1e63c 100644
--- a/Objects/clinic/listobject.c.h
+++ b/Objects/clinic/listobject.c.h
@@ -21,12 +21,12 @@ list_insert(PyListObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwn
Py_ssize_t index;
PyObject *object;
- if (!_PyArg_ParseStack(args, nargs, "nO:insert",
- &index, &object)) {
+ if (!_PyArg_NoStackKeywords("insert", kwnames)) {
goto exit;
}
- if (!_PyArg_NoStackKeywords("insert", kwnames)) {
+ if (!_PyArg_ParseStack(args, nargs, "nO:insert",
+ &index, &object)) {
goto exit;
}
return_value = list_insert_impl(self, index, object);
@@ -109,12 +109,12 @@ list_pop(PyListObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwname
PyObject *return_value = NULL;
Py_ssize_t index = -1;
- if (!_PyArg_ParseStack(args, nargs, "|n:pop",
- &index)) {
+ if (!_PyArg_NoStackKeywords("pop", kwnames)) {
goto exit;
}
- if (!_PyArg_NoStackKeywords("pop", kwnames)) {
+ if (!_PyArg_ParseStack(args, nargs, "|n:pop",
+ &index)) {
goto exit;
}
return_value = list_pop_impl(self, index);
@@ -195,12 +195,12 @@ list_index(PyListObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwna
Py_ssize_t start = 0;
Py_ssize_t stop = PY_SSIZE_T_MAX;
- if (!_PyArg_ParseStack(args, nargs, "O|O&O&:index",
- &value, _PyEval_SliceIndexNotNone, &start, _PyEval_SliceIndexNotNone, &stop)) {
+ if (!_PyArg_NoStackKeywords("index", kwnames)) {
goto exit;
}
- if (!_PyArg_NoStackKeywords("index", kwnames)) {
+ if (!_PyArg_ParseStack(args, nargs, "O|O&O&:index",
+ &value, _PyEval_SliceIndexNotNone, &start, _PyEval_SliceIndexNotNone, &stop)) {
goto exit;
}
return_value = list_index_impl(self, value, start, stop);
@@ -297,4 +297,4 @@ list___reversed__(PyListObject *self, PyObject *Py_UNUSED(ignored))
{
return list___reversed___impl(self);
}
-/*[clinic end generated code: output=71deae70ca0e6799 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=63cbe6d6320e916f input=a9049054013a1b77]*/
diff --git a/Objects/clinic/tupleobject.c.h b/Objects/clinic/tupleobject.c.h
index 880b258dca..a6eedffaff 100644
--- a/Objects/clinic/tupleobject.c.h
+++ b/Objects/clinic/tupleobject.c.h
@@ -25,12 +25,12 @@ tuple_index(PyTupleObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kw
Py_ssize_t start = 0;
Py_ssize_t stop = PY_SSIZE_T_MAX;
- if (!_PyArg_ParseStack(args, nargs, "O|O&O&:index",
- &value, _PyEval_SliceIndexNotNone, &start, _PyEval_SliceIndexNotNone, &stop)) {
+ if (!_PyArg_NoStackKeywords("index", kwnames)) {
goto exit;
}
- if (!_PyArg_NoStackKeywords("index", kwnames)) {
+ if (!_PyArg_ParseStack(args, nargs, "O|O&O&:index",
+ &value, _PyEval_SliceIndexNotNone, &start, _PyEval_SliceIndexNotNone, &stop)) {
goto exit;
}
return_value = tuple_index_impl(self, value, start, stop);
@@ -99,4 +99,4 @@ tuple___getnewargs__(PyTupleObject *self, PyObject *Py_UNUSED(ignored))
{
return tuple___getnewargs___impl(self);
}
-/*[clinic end generated code: output=145bcfff64e8c809 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=70b4de94a0002ec3 input=a9049054013a1b77]*/
diff --git a/Objects/clinic/unicodeobject.c.h b/Objects/clinic/unicodeobject.c.h
index 509405e527..7ae7a99f93 100644
--- a/Objects/clinic/unicodeobject.c.h
+++ b/Objects/clinic/unicodeobject.c.h
@@ -83,12 +83,12 @@ unicode_center(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwna
Py_ssize_t width;
Py_UCS4 fillchar = ' ';
- if (!_PyArg_ParseStack(args, nargs, "n|O&:center",
- &width, convert_uc, &fillchar)) {
+ if (!_PyArg_NoStackKeywords("center", kwnames)) {
goto exit;
}
- if (!_PyArg_NoStackKeywords("center", kwnames)) {
+ if (!_PyArg_ParseStack(args, nargs, "n|O&:center",
+ &width, convert_uc, &fillchar)) {
goto exit;
}
return_value = unicode_center_impl(self, width, fillchar);
@@ -435,12 +435,12 @@ unicode_ljust(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnam
Py_ssize_t width;
Py_UCS4 fillchar = ' ';
- if (!_PyArg_ParseStack(args, nargs, "n|O&:ljust",
- &width, convert_uc, &fillchar)) {
+ if (!_PyArg_NoStackKeywords("ljust", kwnames)) {
goto exit;
}
- if (!_PyArg_NoStackKeywords("ljust", kwnames)) {
+ if (!_PyArg_ParseStack(args, nargs, "n|O&:ljust",
+ &width, convert_uc, &fillchar)) {
goto exit;
}
return_value = unicode_ljust_impl(self, width, fillchar);
@@ -487,13 +487,13 @@ unicode_strip(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnam
PyObject *return_value = NULL;
PyObject *chars = Py_None;
- if (!_PyArg_UnpackStack(args, nargs, "strip",
- 0, 1,
- &chars)) {
+ if (!_PyArg_NoStackKeywords("strip", kwnames)) {
goto exit;
}
- if (!_PyArg_NoStackKeywords("strip", kwnames)) {
+ if (!_PyArg_UnpackStack(args, nargs, "strip",
+ 0, 1,
+ &chars)) {
goto exit;
}
return_value = unicode_strip_impl(self, chars);
@@ -522,13 +522,13 @@ unicode_lstrip(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwna
PyObject *return_value = NULL;
PyObject *chars = NULL;
- if (!_PyArg_UnpackStack(args, nargs, "lstrip",
- 0, 1,
- &chars)) {
+ if (!_PyArg_NoStackKeywords("lstrip", kwnames)) {
goto exit;
}
- if (!_PyArg_NoStackKeywords("lstrip", kwnames)) {
+ if (!_PyArg_UnpackStack(args, nargs, "lstrip",
+ 0, 1,
+ &chars)) {
goto exit;
}
return_value = unicode_lstrip_impl(self, chars);
@@ -557,13 +557,13 @@ unicode_rstrip(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwna
PyObject *return_value = NULL;
PyObject *chars = NULL;
- if (!_PyArg_UnpackStack(args, nargs, "rstrip",
- 0, 1,
- &chars)) {
+ if (!_PyArg_NoStackKeywords("rstrip", kwnames)) {
goto exit;
}
- if (!_PyArg_NoStackKeywords("rstrip", kwnames)) {
+ if (!_PyArg_UnpackStack(args, nargs, "rstrip",
+ 0, 1,
+ &chars)) {
goto exit;
}
return_value = unicode_rstrip_impl(self, chars);
@@ -600,12 +600,12 @@ unicode_replace(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwn
PyObject *new;
Py_ssize_t count = -1;
- if (!_PyArg_ParseStack(args, nargs, "UU|n:replace",
- &old, &new, &count)) {
+ if (!_PyArg_NoStackKeywords("replace", kwnames)) {
goto exit;
}
- if (!_PyArg_NoStackKeywords("replace", kwnames)) {
+ if (!_PyArg_ParseStack(args, nargs, "UU|n:replace",
+ &old, &new, &count)) {
goto exit;
}
return_value = unicode_replace_impl(self, old, new, count);
@@ -635,12 +635,12 @@ unicode_rjust(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnam
Py_ssize_t width;
Py_UCS4 fillchar = ' ';
- if (!_PyArg_ParseStack(args, nargs, "n|O&:rjust",
- &width, convert_uc, &fillchar)) {
+ if (!_PyArg_NoStackKeywords("rjust", kwnames)) {
goto exit;
}
- if (!_PyArg_NoStackKeywords("rjust", kwnames)) {
+ if (!_PyArg_ParseStack(args, nargs, "n|O&:rjust",
+ &width, convert_uc, &fillchar)) {
goto exit;
}
return_value = unicode_rjust_impl(self, width, fillchar);
@@ -840,12 +840,12 @@ unicode_maketrans(void *null, PyObject **args, Py_ssize_t nargs, PyObject *kwnam
PyObject *y = NULL;
PyObject *z = NULL;
- if (!_PyArg_ParseStack(args, nargs, "O|UU:maketrans",
- &x, &y, &z)) {
+ if (!_PyArg_NoStackKeywords("maketrans", kwnames)) {
goto exit;
}
- if (!_PyArg_NoStackKeywords("maketrans", kwnames)) {
+ if (!_PyArg_ParseStack(args, nargs, "O|UU:maketrans",
+ &x, &y, &z)) {
goto exit;
}
return_value = unicode_maketrans_impl(x, y, z);
@@ -962,4 +962,4 @@ unicode_sizeof(PyObject *self, PyObject *Py_UNUSED(ignored))
{
return unicode_sizeof_impl(self);
}
-/*[clinic end generated code: output=88b06f61edd282f9 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=339a83c0c100dd17 input=a9049054013a1b77]*/