* src/plugins/Leak.py (display): Catch exception coming from

trying to call __repr__ on a closed db.DB.


svn: r5903
This commit is contained in:
Alex Roitman 2006-02-09 01:10:10 +00:00
parent 18e8cb6478
commit bdf496ebb2
2 changed files with 14 additions and 4 deletions

View File

@ -1,3 +1,7 @@
2006-02-08 Alex Roitman <shura@gramps-project.org>
* src/plugins/Leak.py (display): Catch exception coming from
trying to call __repr__ on a closed db.DB.
2006-01-26 Brian Matherly <pez4brian@users.sourceforge.net>
* src/plugins/FamilyGroup.py: correctly put borders on the
children cells.

View File

@ -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()