[Zodb-checkins] SVN: ZODB/trunk/src/BTrees/objectkeymacros.h Make chack for default comparison work for Python 2.5.
Jim Fulton
jim at zope.com
Wed Oct 27 17:42:01 EDT 2010
Log message for revision 117975:
Make chack for default comparison work for Python 2.5.
Changed:
U ZODB/trunk/src/BTrees/objectkeymacros.h
-=-
Modified: ZODB/trunk/src/BTrees/objectkeymacros.h
===================================================================
--- ZODB/trunk/src/BTrees/objectkeymacros.h 2010-10-27 20:43:43 UTC (rev 117974)
+++ ZODB/trunk/src/BTrees/objectkeymacros.h 2010-10-27 21:42:01 UTC (rev 117975)
@@ -9,10 +9,20 @@
static int
check_argument_cmp(PyObject *arg)
{
+ /* printf("check cmp %p %p %p %p\n", */
+ /* arg->ob_type->tp_richcompare, */
+ /* ((PyTypeObject *)object_)->ob_type->tp_richcompare, */
+ /* arg->ob_type->tp_compare, */
+ /* ((PyTypeObject *)object_)->ob_type->tp_compare); */
+
if (arg->ob_type->tp_richcompare == NULL
&&
- arg->ob_type->tp_compare ==
- ((PyTypeObject *)object_)->ob_type->tp_compare
+#if PY_MAJOR_VERSION==2 && PY_MINOR_VERSION < 6
+ arg->ob_type->tp_compare == NULL
+#else
+ arg->ob_type->tp_compare ==
+ ((PyTypeObject *)object_)->ob_type->tp_compare
+#endif
)
{
PyErr_SetString(PyExc_TypeError, "Object has default comparison");
More information about the Zodb-checkins
mailing list