Skip to content
This repository has been archived by the owner on May 13, 2020. It is now read-only.

Commit

Permalink
Make absolutely sure that ConflictError cannot be raised during
Browse files Browse the repository at this point in the history
abort when using the ``SerialConflictHandler`` conflict handlers.
  • Loading branch information
strichter committed Oct 16, 2013
1 parent 85d6c54 commit cb8eb51
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ CHANGES
into a set of trivial values that cannot have complex references. (You
should rarely need this feature.)

- Bug: Make absolutely sure that ``ConflictError`` cannot be raised during
abort when using the ``SerialConflictHandler`` conflict handlers.

- Bug: Fix circular reference detection of non-persistent object that were
different instances but equated.

Expand Down
8 changes: 7 additions & 1 deletion src/mongopersist/conflict.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,13 @@ def check_conflict(self, obj):

def has_conflicts(self, objs):
for obj in objs:
if self.check_conflict(obj) is not None:
try:
if self.check_conflict(obj) is not None:
return True
except interfaces.ConflictError, err:
# In some cases even trying to resolve the conflict causes a
# conflict error, so we need to catch the error here to avoid
# infinite recursion.
return True
return False

Expand Down

0 comments on commit cb8eb51

Please sign in to comment.