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

Fred L. Drake, Jr. fred at zope.com
Tue Jan 27 10:47:03 EST 2004


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

Modified Files:
	Zope.py 
Log Message:
change port of the fix for collector issue 1203:
Python 2.3.3 doesn't need to import the types module here anymore


=== Zope/lib/python/ZTUtils/Zope.py 1.14 => 1.15 ===
--- Zope/lib/python/ZTUtils/Zope.py:1.14	Tue Jan 27 09:39:34 2004
+++ Zope/lib/python/ZTUtils/Zope.py	Tue Jan 27 10:47:02 2004
@@ -21,7 +21,6 @@
 from Batch import Batch
 from Products.ZCatalog.Lazy import Lazy
 from AccessControl import getSecurityManager
-from types import StringType, ListType, IntType, FloatType
 from DateTime import DateTime
 
 try:
@@ -36,7 +35,6 @@
 else:
     from AccessControl import Unauthorized
 
-from types import BooleanType
 
 class LazyFilter(Lazy):
     # A LazyFilter that checks with the security policy
@@ -233,14 +231,14 @@
         k, v = pairs[i]
         m = ''
         sublist = None
-        if isinstance(v, StringType):
+        if isinstance(v, str):
             pass
         elif hasattr(v, 'items'):
             sublist = []
             for sk, sv in v.items():
                 sm = simple_marshal(sv)
                 sublist.append(('%s.%s' % (k, sk), '%s:record' % sm,  sv))
-        elif isinstance(v, ListType):
+        elif isinstance(v, list):
             sublist = []
             for sv in v:
                 sm = simple_marshal(sv)
@@ -255,13 +253,13 @@
     return pairs
 
 def simple_marshal(v):
-    if isinstance(v, StringType):
+    if isinstance(v, str):
         return ''
-    if isinstance(v, BooleanType):
+    if isinstance(v, bool):
         return ':boolean'
-    if isinstance(v, IntType):
+    if isinstance(v, int):
         return ':int'
-    if isinstance(v, FloatType):
+    if isinstance(v, float):
         return ':float'
     if isinstance(v, DateTime):
         return ':date'
@@ -283,7 +281,7 @@
     if qs and omit:
         qsparts = qs.split('&')
 
-        if isinstance(omit, StringType):
+        if isinstance(omit, str):
             omits = {omit: None}
         else:
             omits = {}




More information about the Zope-Checkins mailing list