[Zope-Checkins] CVS: Releases/Zope/lib/python/ZTUtils - Zope.py:1.13

Evan Simpson cvs-admin at zope.org
Fri Oct 24 16:16:38 EDT 2003


Update of /cvs-repository/Releases/Zope/lib/python/ZTUtils
In directory cvs.zope.org:/tmp/cvs-serv11418/lib/python/ZTUtils

Modified Files:
	Zope.py 
Log Message:
Support Python 2.3 BooleanType in ZTUtils.


=== Releases/Zope/lib/python/ZTUtils/Zope.py 1.12 => 1.13 ===
--- Releases/Zope/lib/python/ZTUtils/Zope.py:1.12	Thu Jul  3 17:44:59 2003
+++ Releases/Zope/lib/python/ZTUtils/Zope.py	Fri Oct 24 16:16:08 2003
@@ -36,6 +36,12 @@
 else:
     from AccessControl import Unauthorized
 
+# Support pre-Python 2.3 :-(
+try:
+    from types import BooleanType
+except ImportError:
+    BooleanType = None
+
 class LazyFilter(Lazy):
     # A LazyFilter that checks with the security policy
 
@@ -255,6 +261,8 @@
 def simple_marshal(v):
     if isinstance(v, StringType):
         return ''
+    if BooleanType and isinstance(v, BooleanType):
+        return ':boolean'
     if isinstance(v, IntType):
         return ':int'
     if isinstance(v, FloatType):




More information about the Zope-Checkins mailing list