diff --git a/nose/pyversion.py b/nose/pyversion.py index 091238da..e710d212 100644 --- a/nose/pyversion.py +++ b/nose/pyversion.py @@ -55,6 +55,8 @@ def __gt__(self, other): return mycmp(self.obj, other.obj) > 0 def __eq__(self, other): return mycmp(self.obj, other.obj) == 0 + def __hash__(self): + return hash(obj) return Key # Python 2.3 also does not support list-sorting by key, so we need to convert diff --git a/unit_tests/mock.py b/unit_tests/mock.py index 98e7d436..4bcbd005 100644 --- a/unit_tests/mock.py +++ b/unit_tests/mock.py @@ -92,7 +92,7 @@ def __init__(self, **kw): self.__dict__['d'].update(kw) def __getattr__(self, attr): - if not self.__dict__.has_key('d'): + if not 'd' in self.__dict__: return None return self.__dict__['d'].get(attr)