Issue #5506: BytesIO objects now have a getbuffer() method exporting a
view of their contents without duplicating them. The view is both readable
and writable.
diff --git a/Modules/_io/_iomodule.c b/Modules/_io/_iomodule.c
index 733a7b9..c0c8154 100644
--- a/Modules/_io/_iomodule.c
+++ b/Modules/_io/_iomodule.c
@@ -710,6 +710,8 @@
/* BytesIO */
PyBytesIO_Type.tp_base = &PyBufferedIOBase_Type;
ADD_TYPE(&PyBytesIO_Type, "BytesIO");
+ if (PyType_Ready(&_PyBytesIOBuffer_Type) < 0)
+ goto fail;
/* StringIO */
PyStringIO_Type.tp_base = &PyTextIOBase_Type;