[Zodb-checkins] CVS: Zope2/lib/python/ZODB - ConflictResolution.py:1.5
jeremy@digicool.com
jeremy@digicool.com
Wed, 2 May 2001 16:46:03 -0400 (EDT)
Update of /cvs-repository/Zope2/lib/python/ZODB
In directory korak:/tmp/cvs-serv18899
Modified Files:
ConflictResolution.py
Log Message:
Replace blanket try-except for all exceptions with try-except for
exactly one exception, ConflictError
Remove klass._p_resolveConflict line, because it's only apparent
purpose was to raise an AttributeError that was caught by the blanket
try-except. Instead, let the later code, which actually uses
_p_resolveConflict() catch the AttributeError and return 0.
--- Updated File ConflictResolution.py in package Zope2/lib/python/ZODB --
--- ConflictResolution.py 2001/04/12 19:46:07 1.4
+++ ConflictResolution.py 2001/05/02 20:46:02 1.5
@@ -86,6 +86,8 @@
from cPickle import Unpickler, Pickler
import sys
+from ZODB.POSException import ConflictError
+
#import traceback
bad_classes={}
@@ -157,7 +159,6 @@
newstate=unpickler.load()
klass=_classFactory(class_tuple[0], class_tuple[1])
- klass._p_resolveConflict
inst=klass.__basicnew__()
try:
@@ -180,21 +181,7 @@
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
class ConflictResolvingStorage: