diff options
author | Alexandre Vassalotti <alexandre@peadrop.com> | 2007-10-14 02:05:51 (GMT) |
---|---|---|
committer | Alexandre Vassalotti <alexandre@peadrop.com> | 2007-10-14 02:05:51 (GMT) |
commit | 70a237179f1213b0c180898b6e1f0b6c4e9cd11c (patch) | |
tree | a0d454e61877a808e682ab90d2cc268d4ce5f23c /Objects | |
parent | 659e7f44e2f0bc92db8b4e33fb6bae429dcbd205 (diff) | |
download | cpython-70a237179f1213b0c180898b6e1f0b6c4e9cd11c.zip cpython-70a237179f1213b0c180898b6e1f0b6c4e9cd11c.tar.gz cpython-70a237179f1213b0c180898b6e1f0b6c4e9cd11c.tar.bz2 |
Remove the buffer API from PyUnicode as specified by PEP 3137. Also,
fix the error message of the 't' format unit, in getargs.c, so that it
asks for bytes, instead of string.
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/unicodeobject.c | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 73aeec4..def9011 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -8113,15 +8113,6 @@ static PyMappingMethods unicode_as_mapping = { }; -static int -unicode_buffer_getbuffer(PyUnicodeObject *self, Py_buffer *view, int flags) -{ - - return PyBuffer_FillInfo(view, (void *)self->str, - PyUnicode_GET_DATA_SIZE(self), 1, flags); -} - - /* Helpers for PyUnicode_Format() */ static PyObject * @@ -8815,11 +8806,6 @@ PyObject *PyUnicode_Format(PyObject *format, return NULL; } -static PyBufferProcs unicode_as_buffer = { - (getbufferproc) unicode_buffer_getbuffer, - NULL, -}; - static PyObject * unicode_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds); @@ -8903,7 +8889,7 @@ PyTypeObject PyUnicode_Type = { (reprfunc) unicode_str, /* tp_str */ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ - &unicode_as_buffer, /* tp_as_buffer */ + 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_UNICODE_SUBCLASS, /* tp_flags */ unicode_doc, /* tp_doc */ |