summaryrefslogtreecommitdiffstats
path: root/Lib/bsddb/__init__.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2006-02-19 01:21:11 (GMT)
committerGeorg Brandl <georg@python.org>2006-02-19 01:21:11 (GMT)
commit19e2203fffcb0ae98bebe3c21a6233cad6a1453c (patch)
tree216acd50144cc42acd40239706e32ef713c440b5 /Lib/bsddb/__init__.py
parent26caeba35a34afb1ff5ce5104d8598b395b87716 (diff)
downloadcpython-19e2203fffcb0ae98bebe3c21a6233cad6a1453c.zip
cpython-19e2203fffcb0ae98bebe3c21a6233cad6a1453c.tar.gz
cpython-19e2203fffcb0ae98bebe3c21a6233cad6a1453c.tar.bz2
Add a unit test for bug fix #1396678.
Diffstat (limited to 'Lib/bsddb/__init__.py')
-rw-r--r--Lib/bsddb/__init__.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/Lib/bsddb/__init__.py b/Lib/bsddb/__init__.py
index 781a22b..4903584 100644
--- a/Lib/bsddb/__init__.py
+++ b/Lib/bsddb/__init__.py
@@ -111,11 +111,10 @@ class _iter_mixin(UserDict.DictMixin):
return
def iteritems(self):
+ if not self.db:
+ return
try:
- try:
- cur = self._make_iter_cursor()
- except AttributeError:
- return
+ cur = self._make_iter_cursor()
# FIXME-20031102-greg: race condition. cursor could
# be closed by another thread before this call.