Commit 5ab7e7c2 authored by Jeremy Hylton's avatar Jeremy Hylton

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.
parent 2da45a35
......@@ -86,6 +86,8 @@ from cStringIO import StringIO
from cPickle import Unpickler, Pickler
import sys
from ZODB.POSException import ConflictError
#import traceback
bad_classes={}
......@@ -157,7 +159,6 @@ def tryToResolveConflict(self, oid, committedSerial, oldSerial, newpickle,
newstate=unpickler.load()
klass=_classFactory(class_tuple[0], class_tuple[1])
klass._p_resolveConflict
inst=klass.__basicnew__()
try:
......@@ -180,21 +181,7 @@ def tryToResolveConflict(self, oid, committedSerial, oldSerial, newpickle,
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:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment