[Python-checkins] r42480 - python/trunk/Lib/bsddb/__init__.py

georg.brandl python-checkins at python.org
Sun Feb 19 01:53:54 CET 2006


Author: georg.brandl
Date: Sun Feb 19 01:53:54 2006
New Revision: 42480

Modified:
   python/trunk/Lib/bsddb/__init__.py
Log:
Bug #1396678: a closed bsddb.DB raises AttributeError on repr().

It now returns "{}". Is that the correct solution?



Modified: python/trunk/Lib/bsddb/__init__.py
==============================================================================
--- python/trunk/Lib/bsddb/__init__.py	(original)
+++ python/trunk/Lib/bsddb/__init__.py	Sun Feb 19 01:53:54 2006
@@ -112,7 +112,10 @@
 
     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.


More information about the Python-checkins mailing list