[Lxml-checkins] r49555 - lxml/trunk/src/lxml

scoder at codespeak.net scoder at codespeak.net
Sat Dec 8 16:06:53 CET 2007


Author: scoder
Date: Sat Dec  8 16:06:53 2007
New Revision: 49555

Modified:
   lxml/trunk/src/lxml/lxml.etree.pyx
Log:


Modified: lxml/trunk/src/lxml/lxml.etree.pyx
==============================================================================
--- lxml/trunk/src/lxml/lxml.etree.pyx	(original)
+++ lxml/trunk/src/lxml/lxml.etree.pyx	Sat Dec  8 16:06:53 2007
@@ -1746,8 +1746,12 @@
             tree.xmlFree(c_result)
             return 1
 
-    def __richcmp__(self, other, int op):
-        return python.PyObject_RichCompare(dict(self), other, op)
+    def __richcmp__(one, other, int op):
+        if not python.PyDict_Check(one):
+            one = dict(one)
+        if not python.PyDict_Check(other):
+            other = dict(other)
+        return python.PyObject_RichCompare(one, other, op)
 
 cdef class _AttribIterator:
     """Attribute iterator - for internal use only!


More information about the lxml-checkins mailing list