From: Victor Stinner Date: Mon, 30 May 2011 21:21:30 +0000 (+0200) Subject: Close #10616: mention bytes and bytearray in PyObject_AsCharBuffer() error X-Git-Tag: v3.3.0a1~2183^2~42^2~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f2a94216de1750eedaea3f5983996a388a9866e4;p=python Close #10616: mention bytes and bytearray in PyObject_AsCharBuffer() error message --- diff --git a/Objects/abstract.c b/Objects/abstract.c index 11e145f168..f992573d33 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;