summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorR. David Murray <rdmurray@bitdance.com>2010-02-24 02:35:33 (GMT)
committerR. David Murray <rdmurray@bitdance.com>2010-02-24 02:35:33 (GMT)
commit5b06ecf86148251e5dbcc23840db1d5c435f51c0 (patch)
tree361b38cfe6c683bb56ba72b292c5dcec6e197197 /Lib
parentafa4140d9c50b9136b157f6792329d3e5e9dac0a (diff)
downloadcpython-5b06ecf86148251e5dbcc23840db1d5c435f51c0.zip
cpython-5b06ecf86148251e5dbcc23840db1d5c435f51c0.tar.gz
cpython-5b06ecf86148251e5dbcc23840db1d5c435f51c0.tar.bz2
Merged revisions 78412 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r78412 | r.david.murray | 2010-02-23 21:31:27 -0500 (Tue, 23 Feb 2010) | 6 lines Issue 7975: in python 2.6 bsddb.dbshelve switched from DictMixin to MutableMapping, and thereby lost functionality because the replacement functionality was implemented incorrectly or incompletely). Since bsddb isn't in py3k, this patch just goes back to using DictMixin in order to correct the regression. ........
Diffstat (limited to 'Lib')
-rw-r--r--Lib/bsddb/dbshelve.py21
1 files changed, 6 insertions, 15 deletions
diff --git a/Lib/bsddb/dbshelve.py b/Lib/bsddb/dbshelve.py
index e291259..5990df3 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)