diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 944017328..81119dab7 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,7 @@ +2006-02-08 Alex Roitman + * src/plugins/Leak.py (display): Catch exception coming from + trying to call __repr__ on a closed db.DB. + 2006-01-26 Brian Matherly * src/plugins/FamilyGroup.py: correctly put borders on the children cells. diff --git a/gramps2/src/plugins/Leak.py b/gramps2/src/plugins/Leak.py index 990775059..6b0a5cbae 100644 --- a/gramps2/src/plugins/Leak.py +++ b/gramps2/src/plugins/Leak.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2003-2005 Donald N. Allingham +# Copyright (C) 2003-2006 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -31,6 +31,7 @@ Show uncollected objects in a window. #------------------------------------------------------------------------ import os from gettext import gettext as _ +from bsddb.db import DBError #------------------------------------------------------------------------ # @@ -114,10 +115,15 @@ class Leak(Tool.Tool): mylist = [] if len(gc.garbage): for each in gc.garbage: - mylist.append(str(each)) - self.ebuf.set_text(_("Uncollected objects:\n\n") + '\n\n'.join(mylist)) + try: + mylist.append(str(each)) + except DBError: + mylist.append('db.DB instance at %s' % id(each)) + self.ebuf.set_text(_("Uncollected objects:\n\n") + + '\n\n'.join(mylist)) else: - self.ebuf.set_text(_("No uncollected objects\n") + str(gc.get_debug())) + self.ebuf.set_text(_("No uncollected objects\n") + + str(gc.get_debug())) def apply_clicked(self,obj): self.display()