summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTravis E. Oliphant <oliphant@enthought.com>2008-06-06 22:39:47 (GMT)
committerTravis E. Oliphant <oliphant@enthought.com>2008-06-06 22:39:47 (GMT)
commit0144f27602944fb1ef6cb561333f65fef50e79cc (patch)
tree8eb33a4b3362488aaa0bdd010f6b3527e83328d8
parent711c9e954e6b0ff0fa415fc98e375d974ba847ca (diff)
downloadcpython-0144f27602944fb1ef6cb561333f65fef50e79cc.zip
cpython-0144f27602944fb1ef6cb561333f65fef50e79cc.tar.gz
cpython-0144f27602944fb1ef6cb561333f65fef50e79cc.tar.bz2
Remove locking part of new buffer protocol.
-rw-r--r--Include/object.h11
-rw-r--r--Modules/_ctypes/_ctypes.c5
-rw-r--r--Objects/abstract.c6
3 files changed, 0 insertions, 22 deletions
diff --git a/Include/object.h b/Include/object.h
index e0f5650..96e7d86 100644
--- a/Include/object.h
+++ b/Include/object.h
@@ -183,7 +183,6 @@ typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
#define PyBUF_WRITABLE 0x0001
/* we used to include an E, backwards compatible alias */
#define PyBUF_WRITEABLE PyBUF_WRITABLE
-#define PyBUF_LOCK 0x0002
#define PyBUF_FORMAT 0x0004
#define PyBUF_ND 0x0008
#define PyBUF_STRIDES (0x0010 | PyBUF_ND)
@@ -194,25 +193,15 @@ typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
#define PyBUF_CONTIG (PyBUF_ND | PyBUF_WRITABLE)
#define PyBUF_CONTIG_RO (PyBUF_ND)
-#define PyBUF_CONTIG_LCK (PyBUF_ND | PyBUF_LOCK)
-#define PyBUF_CONTIG_XLCK (PyBUF_ND | PyBUF_LOCK | PyBUF_WRITABLE)
#define PyBUF_STRIDED (PyBUF_STRIDES | PyBUF_WRITABLE)
#define PyBUF_STRIDED_RO (PyBUF_STRIDES)
-#define PyBUF_STRIDED_LCK (PyBUF_STRIDES | PyBUF_LOCK)
-#define PyBUF_STRIDED_XLCK (PyBUF_STRIDES | PyBUF_LOCK | PyBUF_WRITABLE)
#define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_WRITABLE | PyBUF_FORMAT)
#define PyBUF_RECORDS_RO (PyBUF_STRIDES | PyBUF_FORMAT)
-#define PyBUF_RECORDS_LCK (PyBUF_STRIDES | PyBUF_LOCK | PyBUF_FORMAT)
-#define PyBUF_RECORDS_XLCK (PyBUF_STRIDES | PyBUF_LOCK | PyBUF_WRITABLE \
- | PyBUF_FORMAT)
#define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_WRITABLE | PyBUF_FORMAT)
#define PyBUF_FULL_RO (PyBUF_INDIRECT | PyBUF_FORMAT)
-#define PyBUF_FULL_LCK (PyBUF_INDIRECT | PyBUF_LOCK | PyBUF_FORMAT)
-#define PyBUF_FULL_XLCK (PyBUF_INDIRECT | PyBUF_LOCK | PyBUF_WRITABLE \
- | PyBUF_FORMAT)
#define PyBUF_READ 0x100
diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c
index 34ec9f2..18851fd 100644
--- a/Modules/_ctypes/_ctypes.c
+++ b/Modules/_ctypes/_ctypes.c
@@ -2502,11 +2502,6 @@ static int CData_NewGetBuffer(PyObject *_self, Py_buffer *view, int flags)
Py_ssize_t i;
if (view == NULL) return 0;
- if (((flags & PyBUF_LOCK) == PyBUF_LOCK)) {
- PyErr_SetString(PyExc_BufferError,
- "Cannot lock this object.");
- return -1;
- }
view->buf = self->b_ptr;
view->len = self->b_size;
diff --git a/Objects/abstract.c b/Objects/abstract.c
index 3e6feb5..aa30129e 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -685,12 +685,6 @@ PyBuffer_FillInfo(Py_buffer *view, void *buf, Py_ssize_t len,
int readonly, int flags)
{
if (view == NULL) return 0;
- if (((flags & PyBUF_LOCK) == PyBUF_LOCK) &&
- readonly != 0) {
- PyErr_SetString(PyExc_BufferError,
- "Cannot lock this object.");
- return -1;
- }
if (((flags & PyBUF_WRITABLE) == PyBUF_WRITABLE) &&
(readonly == 1)) {
PyErr_SetString(PyExc_BufferError,