From: Georg Brandl Date: Sun, 19 Feb 2006 00:53:54 +0000 (+0000) Subject: Bug #1396678: a closed bsddb.DB raises AttributeError on repr(). X-Git-Tag: v2.5a0~603 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=26caeba35a34afb1ff5ce5104d8598b395b87716;p=thirdparty%2FPython%2Fcpython.git Bug #1396678: a closed bsddb.DB raises AttributeError on repr(). It now returns "{}". Is that the correct solution? --- diff --git a/Lib/bsddb/__init__.py b/Lib/bsddb/__init__.py index cfe554b94548..781a22bb7bb0 100644 --- a/Lib/bsddb/__init__.py +++ b/Lib/bsddb/__init__.py @@ -112,7 +112,10 @@ class _iter_mixin(UserDict.DictMixin): def iteritems(self): try: - cur = self._make_iter_cursor() + try: + cur = self._make_iter_cursor() + except AttributeError: + return # FIXME-20031102-greg: race condition. cursor could # be closed by another thread before this call.