[Checkins] SVN: zope.proxy/trunk/ Py3 compatibility.

Tres Seaver cvs-admin at zope.org
Wed Jun 6 20:13:17 UTC 2012


Log message for revision 126623:
  Py3 compatibility.

Changed:
  _U  zope.proxy/trunk/
  U   zope.proxy/trunk/src/zope/proxy/__init__.py

-=-
Modified: zope.proxy/trunk/src/zope/proxy/__init__.py
===================================================================
--- zope.proxy/trunk/src/zope/proxy/__init__.py	2012-06-06 20:13:10 UTC (rev 126622)
+++ zope.proxy/trunk/src/zope/proxy/__init__.py	2012-06-06 20:13:13 UTC (rev 126623)
@@ -84,6 +84,7 @@
 
     def __nonzero__(self):
         return bool(self._wrapped)
+    __bool__ = __nonzero__ # Python3 compat
 
     def __hash__(self):
         return hash(self._wrapped)
@@ -108,7 +109,7 @@
         return len(self._wrapped)
 
     def __getitem__(self, key):
-        if isinstance(key, types.SliceType):
+        if isinstance(key, slice):
             if isinstance(self._wrapped, (list, tuple)):
                 return self._wrapped[key]
             start, stop = key.start, key.stop



More information about the checkins mailing list