mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
bpo-37034: Display argument name on errors with keyword arguments with Argument Clinic. (GH-13593)
This commit is contained in:
parent
59725f3bad
commit
4901fe274b
62 changed files with 623 additions and 553 deletions
16
Objects/clinic/bytearrayobject.c.h
generated
16
Objects/clinic/bytearrayobject.c.h
generated
|
|
@ -115,14 +115,14 @@ bytearray_maketrans(void *null, PyObject *const *args, Py_ssize_t nargs)
|
|||
goto exit;
|
||||
}
|
||||
if (!PyBuffer_IsContiguous(&frm, 'C')) {
|
||||
_PyArg_BadArgument("maketrans", 1, "contiguous buffer", args[0]);
|
||||
_PyArg_BadArgument("maketrans", "argument 1", "contiguous buffer", args[0]);
|
||||
goto exit;
|
||||
}
|
||||
if (PyObject_GetBuffer(args[1], &to, PyBUF_SIMPLE) != 0) {
|
||||
goto exit;
|
||||
}
|
||||
if (!PyBuffer_IsContiguous(&to, 'C')) {
|
||||
_PyArg_BadArgument("maketrans", 2, "contiguous buffer", args[1]);
|
||||
_PyArg_BadArgument("maketrans", "argument 2", "contiguous buffer", args[1]);
|
||||
goto exit;
|
||||
}
|
||||
return_value = bytearray_maketrans_impl(&frm, &to);
|
||||
|
|
@ -175,14 +175,14 @@ bytearray_replace(PyByteArrayObject *self, PyObject *const *args, Py_ssize_t nar
|
|||
goto exit;
|
||||
}
|
||||
if (!PyBuffer_IsContiguous(&old, 'C')) {
|
||||
_PyArg_BadArgument("replace", 1, "contiguous buffer", args[0]);
|
||||
_PyArg_BadArgument("replace", "argument 1", "contiguous buffer", args[0]);
|
||||
goto exit;
|
||||
}
|
||||
if (PyObject_GetBuffer(args[1], &new, PyBUF_SIMPLE) != 0) {
|
||||
goto exit;
|
||||
}
|
||||
if (!PyBuffer_IsContiguous(&new, 'C')) {
|
||||
_PyArg_BadArgument("replace", 2, "contiguous buffer", args[1]);
|
||||
_PyArg_BadArgument("replace", "argument 2", "contiguous buffer", args[1]);
|
||||
goto exit;
|
||||
}
|
||||
if (nargs < 3) {
|
||||
|
|
@ -735,7 +735,7 @@ bytearray_decode(PyByteArrayObject *self, PyObject *const *args, Py_ssize_t narg
|
|||
}
|
||||
if (args[0]) {
|
||||
if (!PyUnicode_Check(args[0])) {
|
||||
_PyArg_BadArgument("decode", 1, "str", args[0]);
|
||||
_PyArg_BadArgument("decode", "argument 'encoding'", "str", args[0]);
|
||||
goto exit;
|
||||
}
|
||||
Py_ssize_t encoding_length;
|
||||
|
|
@ -752,7 +752,7 @@ bytearray_decode(PyByteArrayObject *self, PyObject *const *args, Py_ssize_t narg
|
|||
}
|
||||
}
|
||||
if (!PyUnicode_Check(args[1])) {
|
||||
_PyArg_BadArgument("decode", 2, "str", args[1]);
|
||||
_PyArg_BadArgument("decode", "argument 'errors'", "str", args[1]);
|
||||
goto exit;
|
||||
}
|
||||
Py_ssize_t errors_length;
|
||||
|
|
@ -854,7 +854,7 @@ bytearray_fromhex(PyTypeObject *type, PyObject *arg)
|
|||
PyObject *string;
|
||||
|
||||
if (!PyUnicode_Check(arg)) {
|
||||
_PyArg_BadArgument("fromhex", 0, "str", arg);
|
||||
_PyArg_BadArgument("fromhex", "argument", "str", arg);
|
||||
goto exit;
|
||||
}
|
||||
if (PyUnicode_READY(arg) == -1) {
|
||||
|
|
@ -1011,4 +1011,4 @@ bytearray_sizeof(PyByteArrayObject *self, PyObject *Py_UNUSED(ignored))
|
|||
{
|
||||
return bytearray_sizeof_impl(self);
|
||||
}
|
||||
/*[clinic end generated code: output=7848247e5469ba1b input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=09df354d3374dfb2 input=a9049054013a1b77]*/
|
||||
|
|
|
|||
20
Objects/clinic/bytesobject.c.h
generated
20
Objects/clinic/bytesobject.c.h
generated
|
|
@ -99,7 +99,7 @@ bytes_partition(PyBytesObject *self, PyObject *arg)
|
|||
goto exit;
|
||||
}
|
||||
if (!PyBuffer_IsContiguous(&sep, 'C')) {
|
||||
_PyArg_BadArgument("partition", 0, "contiguous buffer", arg);
|
||||
_PyArg_BadArgument("partition", "argument", "contiguous buffer", arg);
|
||||
goto exit;
|
||||
}
|
||||
return_value = bytes_partition_impl(self, &sep);
|
||||
|
|
@ -142,7 +142,7 @@ bytes_rpartition(PyBytesObject *self, PyObject *arg)
|
|||
goto exit;
|
||||
}
|
||||
if (!PyBuffer_IsContiguous(&sep, 'C')) {
|
||||
_PyArg_BadArgument("rpartition", 0, "contiguous buffer", arg);
|
||||
_PyArg_BadArgument("rpartition", "argument", "contiguous buffer", arg);
|
||||
goto exit;
|
||||
}
|
||||
return_value = bytes_rpartition_impl(self, &sep);
|
||||
|
|
@ -420,14 +420,14 @@ bytes_maketrans(void *null, PyObject *const *args, Py_ssize_t nargs)
|
|||
goto exit;
|
||||
}
|
||||
if (!PyBuffer_IsContiguous(&frm, 'C')) {
|
||||
_PyArg_BadArgument("maketrans", 1, "contiguous buffer", args[0]);
|
||||
_PyArg_BadArgument("maketrans", "argument 1", "contiguous buffer", args[0]);
|
||||
goto exit;
|
||||
}
|
||||
if (PyObject_GetBuffer(args[1], &to, PyBUF_SIMPLE) != 0) {
|
||||
goto exit;
|
||||
}
|
||||
if (!PyBuffer_IsContiguous(&to, 'C')) {
|
||||
_PyArg_BadArgument("maketrans", 2, "contiguous buffer", args[1]);
|
||||
_PyArg_BadArgument("maketrans", "argument 2", "contiguous buffer", args[1]);
|
||||
goto exit;
|
||||
}
|
||||
return_value = bytes_maketrans_impl(&frm, &to);
|
||||
|
|
@ -480,14 +480,14 @@ bytes_replace(PyBytesObject *self, PyObject *const *args, Py_ssize_t nargs)
|
|||
goto exit;
|
||||
}
|
||||
if (!PyBuffer_IsContiguous(&old, 'C')) {
|
||||
_PyArg_BadArgument("replace", 1, "contiguous buffer", args[0]);
|
||||
_PyArg_BadArgument("replace", "argument 1", "contiguous buffer", args[0]);
|
||||
goto exit;
|
||||
}
|
||||
if (PyObject_GetBuffer(args[1], &new, PyBUF_SIMPLE) != 0) {
|
||||
goto exit;
|
||||
}
|
||||
if (!PyBuffer_IsContiguous(&new, 'C')) {
|
||||
_PyArg_BadArgument("replace", 2, "contiguous buffer", args[1]);
|
||||
_PyArg_BadArgument("replace", "argument 2", "contiguous buffer", args[1]);
|
||||
goto exit;
|
||||
}
|
||||
if (nargs < 3) {
|
||||
|
|
@ -568,7 +568,7 @@ bytes_decode(PyBytesObject *self, PyObject *const *args, Py_ssize_t nargs, PyObj
|
|||
}
|
||||
if (args[0]) {
|
||||
if (!PyUnicode_Check(args[0])) {
|
||||
_PyArg_BadArgument("decode", 1, "str", args[0]);
|
||||
_PyArg_BadArgument("decode", "argument 'encoding'", "str", args[0]);
|
||||
goto exit;
|
||||
}
|
||||
Py_ssize_t encoding_length;
|
||||
|
|
@ -585,7 +585,7 @@ bytes_decode(PyBytesObject *self, PyObject *const *args, Py_ssize_t nargs, PyObj
|
|||
}
|
||||
}
|
||||
if (!PyUnicode_Check(args[1])) {
|
||||
_PyArg_BadArgument("decode", 2, "str", args[1]);
|
||||
_PyArg_BadArgument("decode", "argument 'errors'", "str", args[1]);
|
||||
goto exit;
|
||||
}
|
||||
Py_ssize_t errors_length;
|
||||
|
|
@ -674,7 +674,7 @@ bytes_fromhex(PyTypeObject *type, PyObject *arg)
|
|||
PyObject *string;
|
||||
|
||||
if (!PyUnicode_Check(arg)) {
|
||||
_PyArg_BadArgument("fromhex", 0, "str", arg);
|
||||
_PyArg_BadArgument("fromhex", "argument", "str", arg);
|
||||
goto exit;
|
||||
}
|
||||
if (PyUnicode_READY(arg) == -1) {
|
||||
|
|
@ -755,4 +755,4 @@ skip_optional_pos:
|
|||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=2d0a3733e13e753a input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=dbed3c3ff6faa382 input=a9049054013a1b77]*/
|
||||
|
|
|
|||
20
Objects/clinic/codeobject.c.h
generated
20
Objects/clinic/codeobject.c.h
generated
|
|
@ -158,7 +158,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje
|
|||
}
|
||||
if (args[7]) {
|
||||
if (!PyBytes_Check(args[7])) {
|
||||
_PyArg_BadArgument("replace", 8, "bytes", args[7]);
|
||||
_PyArg_BadArgument("replace", "argument 'co_code'", "bytes", args[7]);
|
||||
goto exit;
|
||||
}
|
||||
co_code = (PyBytesObject *)args[7];
|
||||
|
|
@ -168,7 +168,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje
|
|||
}
|
||||
if (args[8]) {
|
||||
if (!PyTuple_Check(args[8])) {
|
||||
_PyArg_BadArgument("replace", 9, "tuple", args[8]);
|
||||
_PyArg_BadArgument("replace", "argument 'co_consts'", "tuple", args[8]);
|
||||
goto exit;
|
||||
}
|
||||
co_consts = args[8];
|
||||
|
|
@ -178,7 +178,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje
|
|||
}
|
||||
if (args[9]) {
|
||||
if (!PyTuple_Check(args[9])) {
|
||||
_PyArg_BadArgument("replace", 10, "tuple", args[9]);
|
||||
_PyArg_BadArgument("replace", "argument 'co_names'", "tuple", args[9]);
|
||||
goto exit;
|
||||
}
|
||||
co_names = args[9];
|
||||
|
|
@ -188,7 +188,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje
|
|||
}
|
||||
if (args[10]) {
|
||||
if (!PyTuple_Check(args[10])) {
|
||||
_PyArg_BadArgument("replace", 11, "tuple", args[10]);
|
||||
_PyArg_BadArgument("replace", "argument 'co_varnames'", "tuple", args[10]);
|
||||
goto exit;
|
||||
}
|
||||
co_varnames = args[10];
|
||||
|
|
@ -198,7 +198,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje
|
|||
}
|
||||
if (args[11]) {
|
||||
if (!PyTuple_Check(args[11])) {
|
||||
_PyArg_BadArgument("replace", 12, "tuple", args[11]);
|
||||
_PyArg_BadArgument("replace", "argument 'co_freevars'", "tuple", args[11]);
|
||||
goto exit;
|
||||
}
|
||||
co_freevars = args[11];
|
||||
|
|
@ -208,7 +208,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje
|
|||
}
|
||||
if (args[12]) {
|
||||
if (!PyTuple_Check(args[12])) {
|
||||
_PyArg_BadArgument("replace", 13, "tuple", args[12]);
|
||||
_PyArg_BadArgument("replace", "argument 'co_cellvars'", "tuple", args[12]);
|
||||
goto exit;
|
||||
}
|
||||
co_cellvars = args[12];
|
||||
|
|
@ -218,7 +218,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje
|
|||
}
|
||||
if (args[13]) {
|
||||
if (!PyUnicode_Check(args[13])) {
|
||||
_PyArg_BadArgument("replace", 14, "str", args[13]);
|
||||
_PyArg_BadArgument("replace", "argument 'co_filename'", "str", args[13]);
|
||||
goto exit;
|
||||
}
|
||||
if (PyUnicode_READY(args[13]) == -1) {
|
||||
|
|
@ -231,7 +231,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje
|
|||
}
|
||||
if (args[14]) {
|
||||
if (!PyUnicode_Check(args[14])) {
|
||||
_PyArg_BadArgument("replace", 15, "str", args[14]);
|
||||
_PyArg_BadArgument("replace", "argument 'co_name'", "str", args[14]);
|
||||
goto exit;
|
||||
}
|
||||
if (PyUnicode_READY(args[14]) == -1) {
|
||||
|
|
@ -243,7 +243,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje
|
|||
}
|
||||
}
|
||||
if (!PyBytes_Check(args[15])) {
|
||||
_PyArg_BadArgument("replace", 16, "bytes", args[15]);
|
||||
_PyArg_BadArgument("replace", "argument 'co_lnotab'", "bytes", args[15]);
|
||||
goto exit;
|
||||
}
|
||||
co_lnotab = (PyBytesObject *)args[15];
|
||||
|
|
@ -253,4 +253,4 @@ skip_optional_kwonly:
|
|||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=624ab6f2ea8f0ea4 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=fade581d6313a0c2 input=a9049054013a1b77]*/
|
||||
|
|
|
|||
10
Objects/clinic/floatobject.c.h
generated
10
Objects/clinic/floatobject.c.h
generated
|
|
@ -235,7 +235,7 @@ float___getformat__(PyTypeObject *type, PyObject *arg)
|
|||
const char *typestr;
|
||||
|
||||
if (!PyUnicode_Check(arg)) {
|
||||
_PyArg_BadArgument("__getformat__", 0, "str", arg);
|
||||
_PyArg_BadArgument("__getformat__", "argument", "str", arg);
|
||||
goto exit;
|
||||
}
|
||||
Py_ssize_t typestr_length;
|
||||
|
|
@ -289,7 +289,7 @@ float___set_format__(PyTypeObject *type, PyObject *const *args, Py_ssize_t nargs
|
|||
goto exit;
|
||||
}
|
||||
if (!PyUnicode_Check(args[0])) {
|
||||
_PyArg_BadArgument("__set_format__", 1, "str", args[0]);
|
||||
_PyArg_BadArgument("__set_format__", "argument 1", "str", args[0]);
|
||||
goto exit;
|
||||
}
|
||||
Py_ssize_t typestr_length;
|
||||
|
|
@ -302,7 +302,7 @@ float___set_format__(PyTypeObject *type, PyObject *const *args, Py_ssize_t nargs
|
|||
goto exit;
|
||||
}
|
||||
if (!PyUnicode_Check(args[1])) {
|
||||
_PyArg_BadArgument("__set_format__", 2, "str", args[1]);
|
||||
_PyArg_BadArgument("__set_format__", "argument 2", "str", args[1]);
|
||||
goto exit;
|
||||
}
|
||||
Py_ssize_t fmt_length;
|
||||
|
|
@ -339,7 +339,7 @@ float___format__(PyObject *self, PyObject *arg)
|
|||
PyObject *format_spec;
|
||||
|
||||
if (!PyUnicode_Check(arg)) {
|
||||
_PyArg_BadArgument("__format__", 0, "str", arg);
|
||||
_PyArg_BadArgument("__format__", "argument", "str", arg);
|
||||
goto exit;
|
||||
}
|
||||
if (PyUnicode_READY(arg) == -1) {
|
||||
|
|
@ -351,4 +351,4 @@ float___format__(PyObject *self, PyObject *arg)
|
|||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=c183029d87dd41fa input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=cc8098eb73f1a64c input=a9049054013a1b77]*/
|
||||
|
|
|
|||
6
Objects/clinic/funcobject.c.h
generated
6
Objects/clinic/funcobject.c.h
generated
|
|
@ -44,12 +44,12 @@ func_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
|
|||
goto exit;
|
||||
}
|
||||
if (!PyObject_TypeCheck(fastargs[0], &PyCode_Type)) {
|
||||
_PyArg_BadArgument("function", 1, (&PyCode_Type)->tp_name, fastargs[0]);
|
||||
_PyArg_BadArgument("function", "argument 'code'", (&PyCode_Type)->tp_name, fastargs[0]);
|
||||
goto exit;
|
||||
}
|
||||
code = (PyCodeObject *)fastargs[0];
|
||||
if (!PyDict_Check(fastargs[1])) {
|
||||
_PyArg_BadArgument("function", 2, "dict", fastargs[1]);
|
||||
_PyArg_BadArgument("function", "argument 'globals'", "dict", fastargs[1]);
|
||||
goto exit;
|
||||
}
|
||||
globals = fastargs[1];
|
||||
|
|
@ -75,4 +75,4 @@ skip_optional_pos:
|
|||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=1d01072cd5620d7e input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=3d96afa3396e5c82 input=a9049054013a1b77]*/
|
||||
|
|
|
|||
8
Objects/clinic/longobject.c.h
generated
8
Objects/clinic/longobject.c.h
generated
|
|
@ -74,7 +74,7 @@ int___format__(PyObject *self, PyObject *arg)
|
|||
PyObject *format_spec;
|
||||
|
||||
if (!PyUnicode_Check(arg)) {
|
||||
_PyArg_BadArgument("__format__", 0, "str", arg);
|
||||
_PyArg_BadArgument("__format__", "argument", "str", arg);
|
||||
goto exit;
|
||||
}
|
||||
if (PyUnicode_READY(arg) == -1) {
|
||||
|
|
@ -227,7 +227,7 @@ int_to_bytes(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *
|
|||
length = ival;
|
||||
}
|
||||
if (!PyUnicode_Check(args[1])) {
|
||||
_PyArg_BadArgument("to_bytes", 2, "str", args[1]);
|
||||
_PyArg_BadArgument("to_bytes", "argument 'byteorder'", "str", args[1]);
|
||||
goto exit;
|
||||
}
|
||||
if (PyUnicode_READY(args[1]) == -1) {
|
||||
|
|
@ -293,7 +293,7 @@ int_from_bytes(PyTypeObject *type, PyObject *const *args, Py_ssize_t nargs, PyOb
|
|||
}
|
||||
bytes_obj = args[0];
|
||||
if (!PyUnicode_Check(args[1])) {
|
||||
_PyArg_BadArgument("from_bytes", 2, "str", args[1]);
|
||||
_PyArg_BadArgument("from_bytes", "argument 'byteorder'", "str", args[1]);
|
||||
goto exit;
|
||||
}
|
||||
if (PyUnicode_READY(args[1]) == -1) {
|
||||
|
|
@ -313,4 +313,4 @@ skip_optional_kwonly:
|
|||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=709503897c55bca1 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=77bc3b2615822cb8 input=a9049054013a1b77]*/
|
||||
|
|
|
|||
4
Objects/clinic/moduleobject.c.h
generated
4
Objects/clinic/moduleobject.c.h
generated
|
|
@ -31,7 +31,7 @@ module___init__(PyObject *self, PyObject *args, PyObject *kwargs)
|
|||
goto exit;
|
||||
}
|
||||
if (!PyUnicode_Check(fastargs[0])) {
|
||||
_PyArg_BadArgument("module", 1, "str", fastargs[0]);
|
||||
_PyArg_BadArgument("module", "argument 'name'", "str", fastargs[0]);
|
||||
goto exit;
|
||||
}
|
||||
if (PyUnicode_READY(fastargs[0]) == -1) {
|
||||
|
|
@ -48,4 +48,4 @@ skip_optional_pos:
|
|||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=d7b7ca1237597b08 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=680276bc3a496d7a input=a9049054013a1b77]*/
|
||||
|
|
|
|||
4
Objects/clinic/typeobject.c.h
generated
4
Objects/clinic/typeobject.c.h
generated
|
|
@ -200,7 +200,7 @@ object___format__(PyObject *self, PyObject *arg)
|
|||
PyObject *format_spec;
|
||||
|
||||
if (!PyUnicode_Check(arg)) {
|
||||
_PyArg_BadArgument("__format__", 0, "str", arg);
|
||||
_PyArg_BadArgument("__format__", "argument", "str", arg);
|
||||
goto exit;
|
||||
}
|
||||
if (PyUnicode_READY(arg) == -1) {
|
||||
|
|
@ -248,4 +248,4 @@ object___dir__(PyObject *self, PyObject *Py_UNUSED(ignored))
|
|||
{
|
||||
return object___dir___impl(self);
|
||||
}
|
||||
/*[clinic end generated code: output=ea5734413064fa7e input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=7a6d272d282308f3 input=a9049054013a1b77]*/
|
||||
|
|
|
|||
16
Objects/clinic/unicodeobject.c.h
generated
16
Objects/clinic/unicodeobject.c.h
generated
|
|
@ -157,7 +157,7 @@ unicode_encode(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject
|
|||
}
|
||||
if (args[0]) {
|
||||
if (!PyUnicode_Check(args[0])) {
|
||||
_PyArg_BadArgument("encode", 1, "str", args[0]);
|
||||
_PyArg_BadArgument("encode", "argument 'encoding'", "str", args[0]);
|
||||
goto exit;
|
||||
}
|
||||
Py_ssize_t encoding_length;
|
||||
|
|
@ -174,7 +174,7 @@ unicode_encode(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject
|
|||
}
|
||||
}
|
||||
if (!PyUnicode_Check(args[1])) {
|
||||
_PyArg_BadArgument("encode", 2, "str", args[1]);
|
||||
_PyArg_BadArgument("encode", "argument 'errors'", "str", args[1]);
|
||||
goto exit;
|
||||
}
|
||||
Py_ssize_t errors_length;
|
||||
|
|
@ -712,7 +712,7 @@ unicode_replace(PyObject *self, PyObject *const *args, Py_ssize_t nargs)
|
|||
goto exit;
|
||||
}
|
||||
if (!PyUnicode_Check(args[0])) {
|
||||
_PyArg_BadArgument("replace", 1, "str", args[0]);
|
||||
_PyArg_BadArgument("replace", "argument 1", "str", args[0]);
|
||||
goto exit;
|
||||
}
|
||||
if (PyUnicode_READY(args[0]) == -1) {
|
||||
|
|
@ -720,7 +720,7 @@ unicode_replace(PyObject *self, PyObject *const *args, Py_ssize_t nargs)
|
|||
}
|
||||
old = args[0];
|
||||
if (!PyUnicode_Check(args[1])) {
|
||||
_PyArg_BadArgument("replace", 2, "str", args[1]);
|
||||
_PyArg_BadArgument("replace", "argument 2", "str", args[1]);
|
||||
goto exit;
|
||||
}
|
||||
if (PyUnicode_READY(args[1]) == -1) {
|
||||
|
|
@ -1080,7 +1080,7 @@ unicode_maketrans(void *null, PyObject *const *args, Py_ssize_t nargs)
|
|||
goto skip_optional;
|
||||
}
|
||||
if (!PyUnicode_Check(args[1])) {
|
||||
_PyArg_BadArgument("maketrans", 2, "str", args[1]);
|
||||
_PyArg_BadArgument("maketrans", "argument 2", "str", args[1]);
|
||||
goto exit;
|
||||
}
|
||||
if (PyUnicode_READY(args[1]) == -1) {
|
||||
|
|
@ -1091,7 +1091,7 @@ unicode_maketrans(void *null, PyObject *const *args, Py_ssize_t nargs)
|
|||
goto skip_optional;
|
||||
}
|
||||
if (!PyUnicode_Check(args[2])) {
|
||||
_PyArg_BadArgument("maketrans", 3, "str", args[2]);
|
||||
_PyArg_BadArgument("maketrans", "argument 3", "str", args[2]);
|
||||
goto exit;
|
||||
}
|
||||
if (PyUnicode_READY(args[2]) == -1) {
|
||||
|
|
@ -1202,7 +1202,7 @@ unicode___format__(PyObject *self, PyObject *arg)
|
|||
PyObject *format_spec;
|
||||
|
||||
if (!PyUnicode_Check(arg)) {
|
||||
_PyArg_BadArgument("__format__", 0, "str", arg);
|
||||
_PyArg_BadArgument("__format__", "argument", "str", arg);
|
||||
goto exit;
|
||||
}
|
||||
if (PyUnicode_READY(arg) == -1) {
|
||||
|
|
@ -1232,4 +1232,4 @@ unicode_sizeof(PyObject *self, PyObject *Py_UNUSED(ignored))
|
|||
{
|
||||
return unicode_sizeof_impl(self);
|
||||
}
|
||||
/*[clinic end generated code: output=d1541724cb4a0070 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=d9a6ee45ddd0ccfd input=a9049054013a1b77]*/
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ stringlib_ljust(PyObject *self, PyObject *const *args, Py_ssize_t nargs)
|
|||
fillchar = PyByteArray_AS_STRING(args[1])[0];
|
||||
}
|
||||
else {
|
||||
_PyArg_BadArgument("ljust", 2, "a byte string of length 1", args[1]);
|
||||
_PyArg_BadArgument("ljust", "argument 2", "a byte string of length 1", args[1]);
|
||||
goto exit;
|
||||
}
|
||||
skip_optional:
|
||||
|
|
@ -161,7 +161,7 @@ stringlib_rjust(PyObject *self, PyObject *const *args, Py_ssize_t nargs)
|
|||
fillchar = PyByteArray_AS_STRING(args[1])[0];
|
||||
}
|
||||
else {
|
||||
_PyArg_BadArgument("rjust", 2, "a byte string of length 1", args[1]);
|
||||
_PyArg_BadArgument("rjust", "argument 2", "a byte string of length 1", args[1]);
|
||||
goto exit;
|
||||
}
|
||||
skip_optional:
|
||||
|
|
@ -222,7 +222,7 @@ stringlib_center(PyObject *self, PyObject *const *args, Py_ssize_t nargs)
|
|||
fillchar = PyByteArray_AS_STRING(args[1])[0];
|
||||
}
|
||||
else {
|
||||
_PyArg_BadArgument("center", 2, "a byte string of length 1", args[1]);
|
||||
_PyArg_BadArgument("center", "argument 2", "a byte string of length 1", args[1]);
|
||||
goto exit;
|
||||
}
|
||||
skip_optional:
|
||||
|
|
@ -274,4 +274,4 @@ stringlib_zfill(PyObject *self, PyObject *arg)
|
|||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=96cbb19b238d0e84 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=15be047aef999b4e input=a9049054013a1b77]*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue