PageRenderTime 541ms CodeModel.GetById 194ms app.highlight 2ms RepoModel.GetById 191ms app.codeStats 0ms

/Lib/dbhash.py

http://unladen-swallow.googlecode.com/
Python | 19 lines | 13 code | 4 blank | 2 comment | 1 complexity | 1d0b5a24927c448b3fa353a4705b8be3 MD5 | raw file
 1"""Provide a (g)dbm-compatible interface to bsddb.hashopen."""
 2
 3import sys
 4if sys.py3kwarning:
 5    import warnings
 6    warnings.warnpy3k("in 3.x, dbhash has been removed", DeprecationWarning, 2)
 7try:
 8    import bsddb
 9except ImportError:
10    # prevent a second import of this module from spuriously succeeding
11    del sys.modules[__name__]
12    raise
13
14__all__ = ["error","open"]
15
16error = bsddb.error                     # Exported for anydbm
17
18def open(file, flag = 'r', mode=0666):
19    return bsddb.hashopen(file, flag, mode)