summaryrefslogtreecommitdiffstats
path: root/Objects/abstract.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-05-30 21:21:30 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-05-30 21:21:30 (GMT)
commitf2a94216de1750eedaea3f5983996a388a9866e4 (patch)
tree1610560fe8d5595304f7302b0225f9fff2529d66 /Objects/abstract.c
parent2a12974bca2433eea0131d904a423ed8234dcf7a (diff)
downloadcpython-f2a94216de1750eedaea3f5983996a388a9866e4.zip
cpython-f2a94216de1750eedaea3f5983996a388a9866e4.tar.gz
cpython-f2a94216de1750eedaea3f5983996a388a9866e4.tar.bz2
Close #10616: mention bytes and bytearray in PyObject_AsCharBuffer() error
message
Diffstat (limited to 'Objects/abstract.c')
-rw-r--r--Objects/abstract.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c
index 11e145f..f992573 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -237,7 +237,8 @@ PyObject_AsCharBuffer(PyObject *obj,
pb = obj->ob_type->tp_as_buffer;
if (pb == NULL || pb->bf_getbuffer == NULL) {
PyErr_SetString(PyExc_TypeError,
- "expected an object with the buffer interface");
+ "expected bytes, bytearray "
+ "or buffer compatible object");
return -1;
}
if ((*pb->bf_getbuffer)(obj, &view, PyBUF_SIMPLE)) return -1;