changeset: 94622:ad4a8176a71a branch: 3.4 parent: 94620:8d32453dd0f7 user: Berker Peksag date: Sun Feb 15 00:31:00 2015 +0200 files: Modules/binascii.c description: Issue #13637: Improve exception message of a2b_* functions. Patch by Vajrasky Kok. diff -r 8d32453dd0f7 -r ad4a8176a71a Modules/binascii.c --- a/Modules/binascii.c Sun Feb 15 00:05:42 2015 +0200 +++ b/Modules/binascii.c Sun Feb 15 00:31:00 2015 +0200 @@ -228,13 +228,13 @@ 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; }