[Libreoffice-bugs] [Bug 46926] PyUNO structure comparisons broken (always false)

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sun Mar 4 00:13:37 CET 2012


https://bugs.freedesktop.org/show_bug.cgi?id=46926

--- Comment #1 from db3l.net at gmail.com 2012-03-03 15:13:37 PST ---
Ok, this turned out to be pretty simple.  While a new rich comparison function
was implemented in the Python 3 changeset, the tp_flags value in the object
type structure was not set to indicate that rich comparisons were supported.

So the comparison function was never called, and nothing (aside from comparing 
an object to itself) will ever compare true.

I'm attaching a patch correcting this.  I also adjusted the final return code
of the comparison function, though I still suspect the function can never
be called with anything but Py_EQ, so perhaps arguably all support for Py_NE
should be removed.  This was a smaller change though.

The patch includes a small change to include the older cmpfunc reference in
the type structure, to maintain consistency with the rest of the structure 
where method values (even if null) show the casts.

-- David

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the Libreoffice-bugs mailing list