[Zodb-checkins] CVS: ZODB3/ZEO/zrpc - log.py:1.9

Jeremy Hylton cvs-admin at zope.org
Wed Oct 29 10:42:01 EST 2003


Update of /cvs-repository/ZODB3/ZEO/zrpc
In directory cvs.zope.org:/tmp/cvs-serv8003/ZEO/zrpc

Modified Files:
	log.py 
Log Message:
Handle list and tuple with the same branch in short_repr().

XXX thought I already checked this in.


=== ZODB3/ZEO/zrpc/log.py 1.8 => 1.9 ===
--- ZODB3/ZEO/zrpc/log.py:1.8	Thu Apr 17 17:16:49 2003
+++ ZODB3/ZEO/zrpc/log.py	Wed Oct 29 10:42:00 2003
@@ -45,7 +45,7 @@
     # The pickle is near the beginning, too, and you can often fit the
     # module name in the pickle.
 
-    if isinstance(obj, types.StringType):
+    if isinstance(obj, str):
         if len(obj) > REPR_LIMIT:
             r = repr(obj[:REPR_LIMIT])
         else:
@@ -53,7 +53,7 @@
         if len(r) > REPR_LIMIT:
             r = r[:REPR_LIMIT-4] + '...' + r[-1]
         return r
-    elif isinstance(obj, types.TupleType):
+    elif isinstance(obj, (list, tuple)):
         elts = []
         size = 0
         for elt in obj:
@@ -62,7 +62,10 @@
             size += len(r)
             if size > REPR_LIMIT:
                 break
-        r = "(%s)" % (", ".join(elts))
+        if isinstance(obj, tuple):
+            r = "(%s)" % (", ".join(elts))
+        else:
+            r = "[%s]" % (", ".join(elts))
     else:
         r = repr(obj)
     if len(r) > REPR_LIMIT:




More information about the Zodb-checkins mailing list