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/rangeobject.h b/Include/rangeobject.h
index 359bcb6..407fd16 100644
--- a/Include/rangeobject.h
+++ b/Include/rangeobject.h
@@ -20,7 +20,7 @@
 
 PyAPI_DATA(PyTypeObject) PyRange_Type;
 
-#define PyRange_Check(op) ((op)->ob_type == &PyRange_Type)
+#define PyRange_Check(op) (Py_Type(op) == &PyRange_Type)
 
 #ifdef __cplusplus
 }