summaryrefslogtreecommitdiff
path: root/Objects
diff options
context:
space:
mode:
Diffstat (limited to 'Objects')
-rw-r--r--Objects/abstract.c2
-rw-r--r--Objects/unicodeobject.c4
2 files changed, 1 insertions, 5 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c
index 3d736d1c13..e848f8fd7f 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -236,7 +236,7 @@ PyObject_AsCharBuffer(PyObject *obj,
"expected an object with the buffer interface");
return -1;
}
- if ((*pb->bf_getbuffer)(obj, &view, PyBUF_CHARACTER)) return -1;
+ if ((*pb->bf_getbuffer)(obj, &view, PyBUF_SIMPLE)) return -1;
*buffer = view.buf;
*buffer_len = view.len;
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index e622967d1d..73aeec4ab4 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -8117,10 +8117,6 @@ static int
unicode_buffer_getbuffer(PyUnicodeObject *self, Py_buffer *view, int flags)
{
- if (flags & PyBUF_CHARACTER) {
- PyErr_SetString(PyExc_SystemError, "can't use str as char buffer");
- return -1;
- }
return PyBuffer_FillInfo(view, (void *)self->str,
PyUnicode_GET_DATA_SIZE(self), 1, flags);
}