summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2006-02-19 00:53:54 (GMT)
committerGeorg Brandl <georg@python.org>2006-02-19 00:53:54 (GMT)
commit26caeba35a34afb1ff5ce5104d8598b395b87716 (patch)
tree16fd1bbdde0234214cb856a60e6809fdb1647f21 /Lib
parentbb459734550094e9ea85d327afe87dc179b59986 (diff)
downloadcpython-26caeba35a34afb1ff5ce5104d8598b395b87716.zip
cpython-26caeba35a34afb1ff5ce5104d8598b395b87716.tar.gz
cpython-26caeba35a34afb1ff5ce5104d8598b395b87716.tar.bz2
Bug #1396678: a closed bsddb.DB raises AttributeError on repr().
It now returns "{}". Is that the correct solution?
Diffstat (limited to 'Lib')
-rw-r--r--Lib/bsddb/__init__.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/bsddb/__init__.py b/Lib/bsddb/__init__.py
index cfe554b..781a22b 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.