diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 173412d37..656e4221b 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,8 @@ +2005-12-17 Richard Taylor + * src/GrampsBSDDB.py: added work around for cursor set not + returing None. + * test/GrampsDbBase_Test.py: corrected indent as found by Benny + 2005-12-16 Richard Taylor * test/GrampsDbBase_Test.py: added a crude performance test. * test/RunAllTests.py: fixed log level setting. diff --git a/gramps2/src/GrampsBSDDB.py b/gramps2/src/GrampsBSDDB.py index 43b3b69b3..9b5cf8c14 100644 --- a/gramps2/src/GrampsBSDDB.py +++ b/gramps2/src/GrampsBSDDB.py @@ -449,7 +449,11 @@ class GrampsBSDDB(GrampsDbBase): # that include a reference to the object we are looking for. referenced_cur = self.get_reference_map_referenced_cursor() - ret = referenced_cur.set(handle) + try: + ret = referenced_cur.set(handle) + except: + ret = None + while (ret is not None): (key,data) = ret @@ -472,8 +476,11 @@ class GrampsBSDDB(GrampsDbBase): """Remove all references to the primary object from the reference_map""" primary_cur = self.get_reference_map_primary_cursor() - - ret = primary_cur.set(handle) + + try: + ret = primary_cur.set(handle) + except: + ret = None while (ret is not None): (key,data) = ret diff --git a/gramps2/test/GrampsDbBase_Test.py b/gramps2/test/GrampsDbBase_Test.py index 5826bac50..8b0c78128 100644 --- a/gramps2/test/GrampsDbBase_Test.py +++ b/gramps2/test/GrampsDbBase_Test.py @@ -60,7 +60,7 @@ class ReferenceMapTest (unittest.TestCase): lnk_sources.add(sources[source_idx-1]) source_idx = (source_idx+1) % len(sources) - add_func(lnk_sources) + add_func(lnk_sources) return @@ -202,7 +202,7 @@ class ReferenceMapTest (unittest.TestCase): def test_performance(self): self._populate_database(num_sources = 100, - num_persons = 10, + num_persons = 80, num_families = 10, num_events = 10, num_places = 10,