diff Objects/unicodeobject.c @ 43560:ac62eb267206

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.
author Alexandre Vassalotti <alexandre@peadrop.com>
date Sun, 14 Oct 2007 02:05:51 +0000
parents 8e72dacf7f3a
children 19319e70fc3e
line wrap: on
line diff
--- a/Objects/unicodeobject.c	Sat Oct 13 23:23:58 2007 +0000
+++ b/Objects/unicodeobject.c	Sun Oct 14 02:05:51 2007 +0000
@@ -8113,15 +8113,6 @@
 };
 
 
-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 @@
     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 @@
     (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 */