[Checkins] SVN: zope.interface/trunk/ Fix a regression introduced in 3.6.4, that made one zope.app.interface test fail

Gediminas Paulauskas menesis at pov.lt
Thu Aug 4 10:18:37 EDT 2011


Log message for revision 122462:
  Fix a regression introduced in 3.6.4, that made one zope.app.interface test fail
  

Changed:
  U   zope.interface/trunk/CHANGES.txt
  U   zope.interface/trunk/src/zope/interface/interface.py

-=-
Modified: zope.interface/trunk/CHANGES.txt
===================================================================
--- zope.interface/trunk/CHANGES.txt	2011-08-04 13:44:20 UTC (rev 122461)
+++ zope.interface/trunk/CHANGES.txt	2011-08-04 14:18:37 UTC (rev 122462)
@@ -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)
 ------------------

Modified: zope.interface/trunk/src/zope/interface/interface.py
===================================================================
--- zope.interface/trunk/src/zope/interface/interface.py	2011-08-04 13:44:20 UTC (rev 122461)
+++ zope.interface/trunk/src/zope/interface/interface.py	2011-08-04 14:18:37 UTC (rev 122462)
@@ -682,7 +682,8 @@
         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)



More information about the checkins mailing list