[Zope-Checkins] CVS: Zope2 - ConflictResolution.py:1.1.4.2

jeremy@digicool.com jeremy@digicool.com
Wed, 9 May 2001 17:40:50 -0400 (EDT)


Update of /cvs-repository/Zope2/lib/python/ZODB
In directory korak:/tmp/cvs-serv3691

Modified Files:
      Tag: zope-2_3-branch
	ConflictResolution.py 
Log Message:
Add fix from trunk so that storage does not catch and ignore non
ConflictError exceptions raised by _p_resolveConflict().

Remove attempt to access _p_resolveConflict attribute outside of
try-except and allow later access (for assignment to resolve) to catch
the error cleanly and exit.




--- Updated File ConflictResolution.py in package Zope2/lib/python/ZODB --
--- ConflictResolution.py	2001/03/15 13:10:35	1.1.4.1
+++ ConflictResolution.py	2001/05/09 21:40:49	1.1.4.2
@@ -86,6 +86,8 @@
 from cPickle import Unpickler, Pickler
 import sys
 
+from ZODB.POSException import ConflictError
+
 #import traceback
 
 bad_classes={}
@@ -159,7 +161,6 @@
             
             newstate=unpickler.load()
             klass=_classFactory(class_tuple[0], class_tuple[1])
-            klass._p_resolveConflict                    
             inst=klass.__basicnew__()
             
             try:
@@ -182,20 +183,6 @@
             pickler.dump(resolved)
             #sys.stderr.write(' r%s ' % class_tuple[1]); sys.stderr.flush()
             return file.getvalue(1)
-        except Exception, v:
-            #print '='*70
-            #print v, v.args
-            #print '='*70
-            #print old
-            #print '='*70
-            #print committed
-            #print '='*70
-            #print newstate
-            #print '='*70
-            
-            #traceback.print_exc()
-
-            #sys.stderr.write(' c%s ' % class_tuple[1]); sys.stderr.flush()
-
+        except ConflictError:
             return 0
 



--- Updated File ConflictResolution.py in package Zope2 --
--- ConflictResolution.py	2001/03/15 13:10:35	1.1.4.1
+++ ConflictResolution.py	2001/05/09 21:40:49	1.1.4.2
@@ -86,6 +86,8 @@
 from cPickle import Unpickler, Pickler
 import sys
 
+from ZODB.POSException import ConflictError
+
 #import traceback
 
 bad_classes={}
@@ -159,7 +161,6 @@
             
             newstate=unpickler.load()
             klass=_classFactory(class_tuple[0], class_tuple[1])
-            klass._p_resolveConflict                    
             inst=klass.__basicnew__()
             
             try:
@@ -182,20 +183,6 @@
             pickler.dump(resolved)
             #sys.stderr.write(' r%s ' % class_tuple[1]); sys.stderr.flush()
             return file.getvalue(1)
-        except Exception, v:
-            #print '='*70
-            #print v, v.args
-            #print '='*70
-            #print old
-            #print '='*70
-            #print committed
-            #print '='*70
-            #print newstate
-            #print '='*70
-            
-            #traceback.print_exc()
-
-            #sys.stderr.write(' c%s ' % class_tuple[1]); sys.stderr.flush()
-
+        except ConflictError:
             return 0