Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3cd30c2

Browse files
committed
Issue #13637: Improve exception message of a2b_* functions.
Patch by Vajrasky Kok.
1 parent 50ef8a8 commit 3cd30c2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Modules/binascii.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,13 +228,13 @@ ascii_buffer_converter(PyObject *arg, Py_buffer *buf)
228228
if (PyObject_GetBuffer(arg, buf, PyBUF_SIMPLE) != 0) {
229229
PyErr_Format(PyExc_TypeError,
230230
"argument should be bytes, buffer or ASCII string, "
231-
"not %R", Py_TYPE(arg));
231+
"not '%.100s'", Py_TYPE(arg)->tp_name);
232232
return 0;
233233
}
234234
if (!PyBuffer_IsContiguous(buf, 'C')) {
235235
PyErr_Format(PyExc_TypeError,
236236
"argument should be a contiguous buffer, "
237-
"not %R", Py_TYPE(arg));
237+
"not '%.100s'", Py_TYPE(arg)->tp_name);
238238
PyBuffer_Release(buf);
239239
return 0;
240240
}

0 commit comments

Comments
 (0)