Mercurial > cpython-lru_cache-weakref
diff Objects/memoryobject.c @ 43488:8ba5300cb4b3
Delete bufferobject.[ch].
This will undoubtedly require Windows build file changes too.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Mon, 08 Oct 2007 03:32:34 +0000 |
| parents | 074130a073b6 |
| children | 4ea945cbbb6d |
line wrap: on
line diff
--- a/Objects/memoryobject.c Mon Oct 08 02:46:15 2007 +0000 +++ b/Objects/memoryobject.c Mon Oct 08 03:32:34 2007 +0000 @@ -8,6 +8,8 @@ { if (view != NULL) *view = self->view; + if (self->base == NULL) + return 0; return self->base->ob_type->tp_as_buffer->bf_getbuffer(self->base, NULL, PyBUF_FULL); } @@ -15,7 +17,8 @@ static void memory_releasebuf(PyMemoryViewObject *self, Py_buffer *view) { - PyObject_ReleaseBuffer(self->base, NULL); + if (self->base != NULL) + PyObject_ReleaseBuffer(self->base, NULL); } PyDoc_STRVAR(memory_doc,
