PEP 3123: Provide forward compatibility with Python 3.0, while keeping
backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and
PyVarObject_HEAD_INIT.
diff --git a/Include/bufferobject.h b/Include/bufferobject.h
index 75ba496..639b08d 100644
--- a/Include/bufferobject.h
+++ b/Include/bufferobject.h
@@ -12,7 +12,7 @@
PyAPI_DATA(PyTypeObject) PyBuffer_Type;
-#define PyBuffer_Check(op) ((op)->ob_type == &PyBuffer_Type)
+#define PyBuffer_Check(op) (Py_Type(op) == &PyBuffer_Type)
#define Py_END_OF_BUFFER (-1)