[Checkins] SVN: zope.interface/trunk/ Fix Python 2.5 incompatibility introduced in new tests of ``__hash__``.

Tres Seaver tseaver at palladion.com
Thu Aug 11 23:02:37 EDT 2011


Log message for revision 122559:
  Fix Python 2.5 incompatibility introduced in new tests of ``__hash__``.
  

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

-=-
Modified: zope.interface/trunk/CHANGES.txt
===================================================================
--- zope.interface/trunk/CHANGES.txt	2011-08-11 21:12:42 UTC (rev 122558)
+++ zope.interface/trunk/CHANGES.txt	2011-08-12 03:02:34 UTC (rev 122559)
@@ -4,7 +4,7 @@
 3.6.6 (unreleased)
 ------------------
 
-- TBD
+- Fix Python 2.5 incompatibility introduced in new tests of ``__hash__``.
 
 3.6.5 (2011-08-11)
 ------------------

Modified: zope.interface/trunk/src/zope/interface/tests/test_interface.py
===================================================================
--- zope.interface/trunk/src/zope/interface/tests/test_interface.py	2011-08-11 21:12:42 UTC (rev 122558)
+++ zope.interface/trunk/src/zope/interface/tests/test_interface.py	2011-08-12 03:02:34 UTC (rev 122559)
@@ -13,6 +13,8 @@
 ##############################################################################
 """Test Interface implementation
 """
+from __future__ import with_statement
+
 import doctest
 import unittest
 import sys
@@ -404,7 +406,10 @@
                          hash((('IFoo', 'zope.interface.tests.ifoo'))))
 
     def test_hash_missing_required_attrs(self):
-        from warnings import catch_warnings
+        try:
+            from warnings import catch_warnings
+        except ImportError:  # Python 2.5
+            return
         from zope.interface.interface import InterfaceClass
         class Derived(InterfaceClass):
             def __init__(self):



More information about the checkins mailing list