bpo-37034: Display argument name on errors with keyword arguments wit… · python/cpython@4901fe2 (original) (raw)

`@@ -21,11 +21,11 @@ _io__BufferedIOBase_readinto(PyObject *self, PyObject *arg)

`

21

21

``

22

22

`if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) {

`

23

23

`PyErr_Clear();

`

24

``

`-

_PyArg_BadArgument("readinto", 0, "read-write bytes-like object", arg);

`

``

24

`+

_PyArg_BadArgument("readinto", "argument", "read-write bytes-like object", arg);

`

25

25

` goto exit;

`

26

26

` }

`

27

27

`if (!PyBuffer_IsContiguous(&buffer, 'C')) {

`

28

``

`-

_PyArg_BadArgument("readinto", 0, "contiguous buffer", arg);

`

``

28

`+

_PyArg_BadArgument("readinto", "argument", "contiguous buffer", arg);

`

29

29

` goto exit;

`

30

30

` }

`

31

31

`return_value = _io__BufferedIOBase_readinto_impl(self, &buffer);

`

`@@ -58,11 +58,11 @@ _io__BufferedIOBase_readinto1(PyObject *self, PyObject *arg)

`

58

58

``

59

59

`if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) {

`

60

60

`PyErr_Clear();

`

61

``

`-

_PyArg_BadArgument("readinto1", 0, "read-write bytes-like object", arg);

`

``

61

`+

_PyArg_BadArgument("readinto1", "argument", "read-write bytes-like object", arg);

`

62

62

` goto exit;

`

63

63

` }

`

64

64

`if (!PyBuffer_IsContiguous(&buffer, 'C')) {

`

65

``

`-

_PyArg_BadArgument("readinto1", 0, "contiguous buffer", arg);

`

``

65

`+

_PyArg_BadArgument("readinto1", "argument", "contiguous buffer", arg);

`

66

66

` goto exit;

`

67

67

` }

`

68

68

`return_value = _io__BufferedIOBase_readinto1_impl(self, &buffer);

`

`@@ -243,11 +243,11 @@ _io__Buffered_readinto(buffered *self, PyObject *arg)

`

243

243

``

244

244

`if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) {

`

245

245

`PyErr_Clear();

`

246

``

`-

_PyArg_BadArgument("readinto", 0, "read-write bytes-like object", arg);

`

``

246

`+

_PyArg_BadArgument("readinto", "argument", "read-write bytes-like object", arg);

`

247

247

` goto exit;

`

248

248

` }

`

249

249

`if (!PyBuffer_IsContiguous(&buffer, 'C')) {

`

250

``

`-

_PyArg_BadArgument("readinto", 0, "contiguous buffer", arg);

`

``

250

`+

_PyArg_BadArgument("readinto", "argument", "contiguous buffer", arg);

`

251

251

` goto exit;

`

252

252

` }

`

253

253

`return_value = _io__Buffered_readinto_impl(self, &buffer);

`

`@@ -280,11 +280,11 @@ _io__Buffered_readinto1(buffered *self, PyObject *arg)

`

280

280

``

281

281

`if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) {

`

282

282

`PyErr_Clear();

`

283

``

`-

_PyArg_BadArgument("readinto1", 0, "read-write bytes-like object", arg);

`

``

283

`+

_PyArg_BadArgument("readinto1", "argument", "read-write bytes-like object", arg);

`

284

284

` goto exit;

`

285

285

` }

`

286

286

`if (!PyBuffer_IsContiguous(&buffer, 'C')) {

`

287

``

`-

_PyArg_BadArgument("readinto1", 0, "contiguous buffer", arg);

`

``

287

`+

_PyArg_BadArgument("readinto1", "argument", "contiguous buffer", arg);

`

288

288

` goto exit;

`

289

289

` }

`

290

290

`return_value = _io__Buffered_readinto1_impl(self, &buffer);

`

`@@ -538,7 +538,7 @@ _io_BufferedWriter_write(buffered *self, PyObject *arg)

`

538

538

` goto exit;

`

539

539

` }

`

540

540

`if (!PyBuffer_IsContiguous(&buffer, 'C')) {

`

541

``

`-

_PyArg_BadArgument("write", 0, "contiguous buffer", arg);

`

``

541

`+

_PyArg_BadArgument("write", "argument", "contiguous buffer", arg);

`

542

542

` goto exit;

`

543

543

` }

`

544

544

`return_value = _io_BufferedWriter_write_impl(self, &buffer);

`

`@@ -672,4 +672,4 @@ io_BufferedRandom___init_(PyObject *self, PyObject *args, PyObject *kwargs)

`

672

672

`exit:

`

673

673

`return return_value;

`

674

674

`}

`

675

``

`-

/[clinic end generated code: output=b22b4aedd53c340a input=a9049054013a1b77]/

`

``

675

`+

/[clinic end generated code: output=7246104f6c7d3167 input=a9049054013a1b77]/

`