bytestring.c: Delete unused buffer methods on `C.ByteString'.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 20 Oct 2019 21:07:40 +0000 (22:07 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 10 Apr 2020 21:42:39 +0000 (22:42 +0100)
I think this was needed in some ancient Python in order to inherit the
buffer methods from `str', but Python 2.5 certainly works fine without.

bytestring.c

index f30ca88..0a3e14a 100644 (file)
@@ -310,8 +310,6 @@ static PyMappingMethods bytestring_pymapping = {
   0,                                   /* @mp_ass_subscript@ */
 };
 
-static PyBufferProcs bytestring_pybuffer;
-
 static PyTypeObject bytestring_pytype_skel = {
   PyObject_HEAD_INIT(0) 0,             /* Header */
   "ByteString",                                /* @tp_name@ */
@@ -332,7 +330,7 @@ static PyTypeObject bytestring_pytype_skel = {
   0,                                   /* @tp_str@ */
   0,                                   /* @tp_getattro@ */
   0,                                   /* @tp_setattro@ */
-  &bytestring_pybuffer,                        /* @tp_as_buffer@ */
+  0,                                   /* @tp_as_buffer@ */
   Py_TPFLAGS_DEFAULT |                 /* @tp_flags@ */
     Py_TPFLAGS_CHECKTYPES |
     Py_TPFLAGS_BASETYPE,