bpo-37034: Display argument name on errors with keyword arguments wit… · python/cpython@4901fe2
@@ -21,11 +21,11 @@ _io__BufferedIOBase_readinto(PyObject *self, PyObject *arg)
21212222if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) {
2323PyErr_Clear();
24-_PyArg_BadArgument("readinto", 0, "read-write bytes-like object", arg);
24+_PyArg_BadArgument("readinto", "argument", "read-write bytes-like object", arg);
2525 goto exit;
2626 }
2727if (!PyBuffer_IsContiguous(&buffer, 'C')) {
28-_PyArg_BadArgument("readinto", 0, "contiguous buffer", arg);
28+_PyArg_BadArgument("readinto", "argument", "contiguous buffer", arg);
2929 goto exit;
3030 }
3131return_value = _io__BufferedIOBase_readinto_impl(self, &buffer);
@@ -58,11 +58,11 @@ _io__BufferedIOBase_readinto1(PyObject *self, PyObject *arg)
58585959if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) {
6060PyErr_Clear();
61-_PyArg_BadArgument("readinto1", 0, "read-write bytes-like object", arg);
61+_PyArg_BadArgument("readinto1", "argument", "read-write bytes-like object", arg);
6262 goto exit;
6363 }
6464if (!PyBuffer_IsContiguous(&buffer, 'C')) {
65-_PyArg_BadArgument("readinto1", 0, "contiguous buffer", arg);
65+_PyArg_BadArgument("readinto1", "argument", "contiguous buffer", arg);
6666 goto exit;
6767 }
6868return_value = _io__BufferedIOBase_readinto1_impl(self, &buffer);
@@ -243,11 +243,11 @@ _io__Buffered_readinto(buffered *self, PyObject *arg)
243243244244if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) {
245245PyErr_Clear();
246-_PyArg_BadArgument("readinto", 0, "read-write bytes-like object", arg);
246+_PyArg_BadArgument("readinto", "argument", "read-write bytes-like object", arg);
247247 goto exit;
248248 }
249249if (!PyBuffer_IsContiguous(&buffer, 'C')) {
250-_PyArg_BadArgument("readinto", 0, "contiguous buffer", arg);
250+_PyArg_BadArgument("readinto", "argument", "contiguous buffer", arg);
251251 goto exit;
252252 }
253253return_value = _io__Buffered_readinto_impl(self, &buffer);
@@ -280,11 +280,11 @@ _io__Buffered_readinto1(buffered *self, PyObject *arg)
280280281281if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) {
282282PyErr_Clear();
283-_PyArg_BadArgument("readinto1", 0, "read-write bytes-like object", arg);
283+_PyArg_BadArgument("readinto1", "argument", "read-write bytes-like object", arg);
284284 goto exit;
285285 }
286286if (!PyBuffer_IsContiguous(&buffer, 'C')) {
287-_PyArg_BadArgument("readinto1", 0, "contiguous buffer", arg);
287+_PyArg_BadArgument("readinto1", "argument", "contiguous buffer", arg);
288288 goto exit;
289289 }
290290return_value = _io__Buffered_readinto1_impl(self, &buffer);
@@ -538,7 +538,7 @@ _io_BufferedWriter_write(buffered *self, PyObject *arg)
538538 goto exit;
539539 }
540540if (!PyBuffer_IsContiguous(&buffer, 'C')) {
541-_PyArg_BadArgument("write", 0, "contiguous buffer", arg);
541+_PyArg_BadArgument("write", "argument", "contiguous buffer", arg);
542542 goto exit;
543543 }
544544return_value = _io_BufferedWriter_write_impl(self, &buffer);
@@ -672,4 +672,4 @@ _io_BufferedRandom___init__(PyObject *self, PyObject *args, PyObject *kwargs)
672672exit:
673673return return_value;
674674}
675-/*[clinic end generated code: output=b22b4aedd53c340a input=a9049054013a1b77]*/
675+/*[clinic end generated code: output=7246104f6c7d3167 input=a9049054013a1b77]*/