diff options
author | RĂ©mi Lapeyre <remi.lapeyre@henki.fr> | 2019-08-29 14:49:08 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2019-08-29 14:49:08 (GMT) |
commit | 4901fe274bc82b95dc89bcb3de8802a3dfedab32 (patch) | |
tree | 2e6e4d0b1cdcb499df7f049ebc9dbbdb9f392bbe /Objects/clinic/bytearrayobject.c.h | |
parent | 59725f3badb3028636c8906ecac4ceb0a37f3982 (diff) | |
download | cpython-4901fe274bc82b95dc89bcb3de8802a3dfedab32.zip cpython-4901fe274bc82b95dc89bcb3de8802a3dfedab32.tar.gz cpython-4901fe274bc82b95dc89bcb3de8802a3dfedab32.tar.bz2 |
bpo-37034: Display argument name on errors with keyword arguments with Argument Clinic. (GH-13593)
Diffstat (limited to 'Objects/clinic/bytearrayobject.c.h')
-rw-r--r-- | Objects/clinic/bytearrayobject.c.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Objects/clinic/bytearrayobject.c.h b/Objects/clinic/bytearrayobject.c.h index 08c6eb5..ad8ed7e 100644 --- a/Objects/clinic/bytearrayobject.c.h +++ b/Objects/clinic/bytearrayobject.c.h @@ -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]*/ |