summaryrefslogtreecommitdiffstats
path: root/Include/abstract.h
diff options
context:
space:
mode:
authorTravis E. Oliphant <oliphant@enthought.com>2008-03-18 04:44:57 (GMT)
committerTravis E. Oliphant <oliphant@enthought.com>2008-03-18 04:44:57 (GMT)
commit3781aef8f8f992f78b31c7029004fa7b1ada7304 (patch)
treedfad9642ac35ed35b097ff3d8c939e8b83919d68 /Include/abstract.h
parent6d91be37586ba93cb7c5fa6d5da15cf5b9a19892 (diff)
downloadcpython-3781aef8f8f992f78b31c7029004fa7b1ada7304.zip
cpython-3781aef8f8f992f78b31c7029004fa7b1ada7304.tar.gz
cpython-3781aef8f8f992f78b31c7029004fa7b1ada7304.tar.bz2
Finish backporting new buffer API to Python 2.6. Left to do: memoryview object and structmodule. But, these need to be finished in Python 3.0 first. No objects support the new buffer API in Python 2.6 as of yet, and except for the memoryview object, I don't think they will.
Diffstat (limited to 'Include/abstract.h')
-rw-r--r--Include/abstract.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/Include/abstract.h b/Include/abstract.h
index 159e67d..3e5cf12 100644
--- a/Include/abstract.h
+++ b/Include/abstract.h
@@ -532,9 +532,10 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
/* new buffer API */
#define PyObject_CheckBuffer(obj) \
- (((obj)->ob_type->tp_as_buffer != NULL) && \
- ((obj)->ob_type->tp_as_buffer->bf_getbuffer != NULL))
-
+ (((obj)->ob_type->tp_as_buffer != NULL) && \
+ (PyType_HasFeature((obj)->ob_type, Py_TPFLAGS_HAVE_NEWBUFFER)) && \
+ ((obj)->ob_type->tp_as_buffer->bf_getbuffer != NULL))
+
/* Return 1 if the getbuffer function is available, otherwise
return 0 */