pybsddb with cffi

Check-in [2fd97e0796]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:minor PyPy specific fix as cPickle=pickle
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:2fd97e0796376705cf3a4bd981c85d8380c2e226
User & Date: broker-3 2013-02-07 13:40:37
Context
2013-02-07
13:42
passed test_dbshelve check-in: d2e59555d5 user: broker-3 tags: trunk
13:40
minor PyPy specific fix as cPickle=pickle check-in: 2fd97e0796 user: broker-3 tags: trunk
13:34
added original test_dbshelve.py check-in: aad7dc3724 user: broker-3 tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to bsddb3/dbshelve.py.

245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
        # We do it with *args and **kw so if the default value wasn't
        # given nothing is passed to the extension module.  That way
        # an exception can be raised if set_get_returns_none is turned
        # off.
        data = self.db.get(*args, **kw)
        try:
            return cPickle.loads(data)
        except (EOFError, TypeError, cPickle.UnpicklingError):
            return data  # we may be getting the default value, or None,
                         # so it doesn't need unpickled.

    def get_both(self, key, value, txn=None, flags=0):
        data = _dumps(value, self.protocol)
        data = self.db.get(key, data, txn, flags)
        return cPickle.loads(data)







|







245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
        # We do it with *args and **kw so if the default value wasn't
        # given nothing is passed to the extension module.  That way
        # an exception can be raised if set_get_returns_none is turned
        # off.
        data = self.db.get(*args, **kw)
        try:
            return cPickle.loads(data)
        except (EOFError, TypeError, cPickle.UnpicklingError, IndexError):
            return data  # we may be getting the default value, or None,
                         # so it doesn't need unpickled.

    def get_both(self, key, value, txn=None, flags=0):
        data = _dumps(value, self.protocol)
        data = self.db.get(key, data, txn, flags)
        return cPickle.loads(data)