summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2015-02-14 22:31:26 (GMT)
committerBerker Peksag <berker.peksag@gmail.com>2015-02-14 22:31:26 (GMT)
commit9ab1cc4fe49fe613a0d09d91fc4f07bc8730af36 (patch)
tree8faf74fd682612ee011585dc08bf6e9c0f481a53 /Modules
parent2eb8f8178b61c6b2392675cbe5f1b0111194c19e (diff)
parent3cd30c2ceeaeabe0486a2467fd11cdc008bf6f67 (diff)
downloadcpython-9ab1cc4fe49fe613a0d09d91fc4f07bc8730af36.zip
cpython-9ab1cc4fe49fe613a0d09d91fc4f07bc8730af36.tar.gz
cpython-9ab1cc4fe49fe613a0d09d91fc4f07bc8730af36.tar.bz2
Issue #13637: Improve exception message of a2b_* functions.
Patch by Vajrasky Kok.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/binascii.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/binascii.c b/Modules/binascii.c
index 86b63bb..4e6953b 100644
--- a/Modules/binascii.c
+++ b/Modules/binascii.c
@@ -228,13 +228,13 @@ ascii_buffer_converter(PyObject *arg, Py_buffer *buf)
if (PyObject_GetBuffer(arg, buf, PyBUF_SIMPLE) != 0) {
PyErr_Format(PyExc_TypeError,
"argument should be bytes, buffer or ASCII string, "
- "not %R", Py_TYPE(arg));
+ "not '%.100s'", Py_TYPE(arg)->tp_name);
return 0;
}
if (!PyBuffer_IsContiguous(buf, 'C')) {
PyErr_Format(PyExc_TypeError,
"argument should be a contiguous buffer, "
- "not %R", Py_TYPE(arg));
+ "not '%.100s'", Py_TYPE(arg)->tp_name);
PyBuffer_Release(buf);
return 0;
}