summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES.txt4
-rw-r--r--src/zope/interface/interface.py3
2 files changed, 5 insertions, 2 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index bd82690..c0f394a 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -11,10 +11,12 @@
- Fix testing deprecation warnings issued when tested under Py3K.
+- Fix ``InterfaceClass.__hash__`` to match comparison function.
+
3.6.4 (2011-07-04)
------------------
-- LP 804951: InterfaceClass instances were unhashable under Python 3.x.
+- LP #804951: InterfaceClass instances were unhashable under Python 3.x.
3.6.3 (2011-05-26)
------------------
diff --git a/src/zope/interface/interface.py b/src/zope/interface/interface.py
index 6b2d513..44c631d 100644
--- a/src/zope/interface/interface.py
+++ b/src/zope/interface/interface.py
@@ -682,7 +682,8 @@ class InterfaceClass(Element, InterfaceBase, Specification):
return (n1 > n2) - (n1 < n2)
def __hash__(self):
- return hash((self.__name__, self.__module__))
+ return hash((getattr(self, '__name__', ''),
+ getattr(self, '__module__', '')))
def __eq__(self, other):
c = self.__cmp(self, other)