From f2a94216de1750eedaea3f5983996a388a9866e4 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 30 May 2011 23:21:30 +0200 Subject: [PATCH] Close #10616: mention bytes and bytearray in PyObject_AsCharBuffer() error message --- Objects/abstract.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Objects/abstract.c b/Objects/abstract.c index 11e145f1686..f992573d332 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;