In bsddb, replace UserDict.DictMixin with collections.MutableMapping.
I can't test this directly on my build, so letting the buildbots do it for me.
If it fails, expect a reversion.
diff --git a/Lib/bsddb/dbshelve.py b/Lib/bsddb/dbshelve.py
index 8264f2d..942ee17 100644
--- a/Lib/bsddb/dbshelve.py
+++ b/Lib/bsddb/dbshelve.py
@@ -38,12 +38,12 @@
HIGHEST_PROTOCOL = pickle.HIGHEST_PROTOCOL
def _dumps(object, protocol):
return pickle.dumps(object, protocol=protocol)
- from UserDict import DictMixin
+ from collections import MutableMapping
else:
HIGHEST_PROTOCOL = None
def _dumps(object, protocol):
return pickle.dumps(object, bin=protocol)
- class DictMixin: pass
+ class MutableMapping: pass
from . import db
@@ -90,7 +90,7 @@
class DBShelveError(db.DBError): pass
-class DBShelf(DictMixin):
+class DBShelf(MutableMapping):
"""A shelf to hold pickled objects, built upon a bsddb DB object. It
automatically pickles/unpickles data objects going to/from the DB.
"""
@@ -141,6 +141,8 @@
else:
return self.db.keys()
+ def __iter__(self):
+ return iter(self.keys())
def open(self, *args, **kwargs):
self.db.open(*args, **kwargs)