[Zodb-checkins] SVN: ZODB/branches/matt-python-versions/src/ZODB/POSException.py Changed "reduce" definition for different Python versions.

matt@zope.com cvs-admin at zope.org
Wed Nov 19 10:57:07 EST 2008


Log message for revision 93139:
  Changed "reduce" definition for different Python versions.
  

Changed:
  U   ZODB/branches/matt-python-versions/src/ZODB/POSException.py

-=-
Modified: ZODB/branches/matt-python-versions/src/ZODB/POSException.py
===================================================================
--- ZODB/branches/matt-python-versions/src/ZODB/POSException.py	2008-11-19 13:43:38 UTC (rev 93138)
+++ ZODB/branches/matt-python-versions/src/ZODB/POSException.py	2008-11-19 15:57:06 UTC (rev 93139)
@@ -47,11 +47,12 @@
 
     message = property(__get_message, __set_message, __del_message)
 
-    def __reduce__(self):
-        # Copy extra data from internal structures
-        state = self.__dict__.copy()
-        #state['message'] = self.message
-        state['args'] = self.args
+    if sys.version_info[:2] <= (2, 5):
+        def __reduce__(self):
+            # Copy extra data from internal structures
+            state = self.__dict__.copy()
+            state['message'] = self.message
+            state['args'] = self.args
 
         return (_recon, (self.__class__, state))
 



More information about the Zodb-checkins mailing list