Staging
v0.5.1
https://github.com/python/cpython
Revision 1680b8c16cacb043df85f312074b684b810f8afe authored by Josiah Carlson on 07 September 2008, 03:53:58 UTC, committed by Josiah Carlson on 07 September 2008, 03:53:58 UTC
1 parent a853a89
Raw File
Tip revision: 1680b8c16cacb043df85f312074b684b810f8afe authored by Josiah Carlson on 07 September 2008, 03:53:58 UTC
This fixes a small inconsistency between trunk and 3.0, closing bug 3764.
Tip revision: 1680b8c
dbhash.py
"""Provide a (g)dbm-compatible interface to bsddb.hashopen."""

import sys
if sys.py3kwarning:
    import warnings
    warnings.warnpy3k("in 3.x, dbhash has been removed", DeprecationWarning, 2)
try:
    import bsddb
except ImportError:
    # prevent a second import of this module from spuriously succeeding
    del sys.modules[__name__]
    raise

__all__ = ["error","open"]

error = bsddb.error                     # Exported for anydbm

def open(file, flag = 'r', mode=0666):
    return bsddb.hashopen(file, flag, mode)
back to top