diff options
author | Jesus Cea <jcea@jcea.es> | 2008-05-13 20:57:59 +0000 |
---|---|---|
committer | Jesus Cea <jcea@jcea.es> | 2008-05-13 20:57:59 +0000 |
commit | 18eb1fa2dd0e4f6b80e1cc31fc712eebfc610154 (patch) | |
tree | 8208c448c32c48d0a8179587745cdad3095f08fe /Lib/bsddb/dbshelve.py | |
parent | cb33aeaf02244f84d37f8f3e3f213b09b1828357 (diff) | |
download | cpython-git-18eb1fa2dd0e4f6b80e1cc31fc712eebfc610154.tar.gz |
Testsuite for bsddb module, version 4.6.4
Diffstat (limited to 'Lib/bsddb/dbshelve.py')
-rw-r--r-- | Lib/bsddb/dbshelve.py | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/Lib/bsddb/dbshelve.py b/Lib/bsddb/dbshelve.py index 96f604a68a..6d7414ed9c 100644 --- a/Lib/bsddb/dbshelve.py +++ b/Lib/bsddb/dbshelve.py @@ -37,9 +37,18 @@ import sys #DictMixin was added if sys.version_info[:3] >= (2, 3, 0): HIGHEST_PROTOCOL = cPickle.HIGHEST_PROTOCOL - def _dumps(object, protocol): - return cPickle.dumps(object, protocol=protocol) +# In python 2.3.*, "cPickle.dumps" accepts no +# named parameters. "pickle.dumps" accepts them, +# so this seems a bug. + if sys.version_info[:3] < (2, 4, 0): + def _dumps(object, protocol): + return cPickle.dumps(object, protocol) + else : + def _dumps(object, protocol): + return cPickle.dumps(object, protocol=protocol) + from UserDict import DictMixin + else: HIGHEST_PROTOCOL = None def _dumps(object, protocol): @@ -133,7 +142,7 @@ class DBShelf(DictMixin): def keys(self, txn=None): - if txn is not None: + if txn != None: return self.db.keys(txn) else: return self.db.keys() @@ -157,7 +166,7 @@ class DBShelf(DictMixin): def items(self, txn=None): - if txn is not None: + if txn != None: items = self.db.items(txn) else: items = self.db.items() @@ -168,7 +177,7 @@ class DBShelf(DictMixin): return newitems def values(self, txn=None): - if txn is not None: + if txn != None: values = self.db.values(txn) else: values = self.db.values() |