Skip to content

Commit

Permalink
Fix test_weakrefs_functional
Browse files Browse the repository at this point in the history
In Python 3 object.__hash__ raises TypeError, so we need an explicit
override if we want hashability.
  • Loading branch information
mgedmin committed Feb 20, 2013
1 parent 8788cb7 commit 631bf4e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ZODB/tests/MinPO.py
Expand Up @@ -21,6 +21,9 @@ def __init__(self, value=None):
def __cmp__(self, aMinPO):
return cmp(self.value, aMinPO.value)

def __hash__(self):
return hash(self.value)

# Py3: Python 3 does not support cmp() anymore. This is insane!!

def __eq__(self, aMinPO):
Expand Down

0 comments on commit 631bf4e

Please sign in to comment.