[Zodb-checkins] CVS: ZODB3/ZEO/zrpc - marshal.py:1.7

Jeremy Hylton jeremy@zope.com
Wed, 25 Sep 2002 18:30:24 -0400


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

Modified Files:
	marshal.py 
Log Message:
Simplify error logging code.

Don't catch a specific set of errors, catch anything, log the message
that failed, and re-raise the exception.

Eliminate unused class variable VERSION and unused import of struct.



=== ZODB3/ZEO/zrpc/marshal.py 1.6 => 1.7 ===
--- ZODB3/ZEO/zrpc/marshal.py:1.6	Wed Sep 25 18:28:10 2002
+++ ZODB3/ZEO/zrpc/marshal.py	Wed Sep 25 18:30:23 2002
@@ -13,7 +13,6 @@
 ##############################################################################
 import cPickle
 from cStringIO import StringIO
-import struct
 import types
 
 import zLOG
@@ -31,13 +30,6 @@
     pickler.fast = 1
     pickle = pickler.dump
 
-    errors = (cPickle.UnpickleableError,
-              cPickle.UnpicklingError,
-              cPickle.PickleError,
-              cPickle.PicklingError)
-
-    VERSION = 1
-
     def encode(self, msgid, flags, name, args):
         """Returns an encoded message"""
         return self.pickle((msgid, flags, name, args), 1)
@@ -49,7 +41,7 @@
 
         try:
             return unpickler.load() # msgid, flags, name, args
-        except (self.errors, IndexError), err_msg:
+        except:
             log("can't decode message: %s" % repr(msg), level=zLOG.ERROR)
             raise