Commit 631bf4ed authored by Marius Gedminas's avatar Marius Gedminas

Fix test_weakrefs_functional

In Python 3 object.__hash__ raises TypeError, so we need an explicit
override if we want hashability.
parent 8788cb71
...@@ -21,6 +21,9 @@ class MinPO(Persistent): ...@@ -21,6 +21,9 @@ class MinPO(Persistent):
def __cmp__(self, aMinPO): def __cmp__(self, aMinPO):
return cmp(self.value, aMinPO.value) return cmp(self.value, aMinPO.value)
def __hash__(self):
return hash(self.value)
# Py3: Python 3 does not support cmp() anymore. This is insane!! # Py3: Python 3 does not support cmp() anymore. This is insane!!
def __eq__(self, aMinPO): def __eq__(self, aMinPO):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment