summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Lib/bsddb/dbshelve.py21
-rw-r--r--Misc/NEWS2
2 files changed, 8 insertions, 15 deletions
diff --git a/Lib/bsddb/dbshelve.py b/Lib/bsddb/dbshelve.py
index 1706ca86f4..7c875b4738 100644
--- a/Lib/bsddb/dbshelve.py
+++ b/Lib/bsddb/dbshelve.py
@@ -59,16 +59,11 @@ else:
return cPickle.dumps(object, bin=protocol)
-if sys.version_info[0:2] <= (2, 5) :
- try:
- from UserDict import DictMixin
- except ImportError:
- # DictMixin is new in Python 2.3
- class DictMixin: pass
- MutableMapping = DictMixin
-else :
- import collections
- MutableMapping = collections.MutableMapping
+try:
+ from UserDict import DictMixin
+except ImportError:
+ # DictMixin is new in Python 2.3
+ class DictMixin: pass
#------------------------------------------------------------------------
@@ -111,7 +106,7 @@ def open(filename, flags=db.DB_CREATE, mode=0660, filetype=db.DB_HASH,
class DBShelveError(db.DBError): pass
-class DBShelf(MutableMapping):
+class DBShelf(DictMixin):
"""A shelf to hold pickled objects, built upon a bsddb DB object. It
automatically pickles/unpickles data objects going to/from the DB.
"""
@@ -162,10 +157,6 @@ class DBShelf(MutableMapping):
else:
return self.db.keys()
- if sys.version_info[0:2] >= (2, 6) :
- def __iter__(self) :
- return self.db.__iter__()
-
def open(self, *args, **kwargs):
self.db.open(*args, **kwargs)
diff --git a/Misc/NEWS b/Misc/NEWS
index 5dc3a7b610..ee77d5dd13 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -30,6 +30,8 @@ Core and Builtins
Library
-------
+- Issue #7975: correct regression in dict methods supported by bsddb.dbshelve.
+
- Issue #7959: ctypes callback functions are now registered correctly
with the cylce garbage collector.