2003-05-05 11:16:41 -03:00
|
|
|
"""Provide a (g)dbm-compatible interface to bsddb.hashopen."""
|
1996-01-25 14:33:39 -04:00
|
|
|
|
2001-01-25 09:47:00 -04:00
|
|
|
import sys
|
2010-04-03 12:38:38 -03:00
|
|
|
import warnings
|
2010-04-03 12:45:59 -03:00
|
|
|
warnings.warnpy3k("in 3.x, the dbhash module has been removed", stacklevel=2)
|
2001-01-25 09:47:00 -04:00
|
|
|
try:
|
|
|
|
import bsddb
|
|
|
|
except ImportError:
|
|
|
|
# prevent a second import of this module from spuriously succeeding
|
|
|
|
del sys.modules[__name__]
|
|
|
|
raise
|
1996-01-25 14:33:39 -04:00
|
|
|
|
2001-01-20 15:54:20 -04:00
|
|
|
__all__ = ["error","open"]
|
|
|
|
|
1999-05-03 15:09:26 -03:00
|
|
|
error = bsddb.error # Exported for anydbm
|
1996-01-25 14:33:39 -04:00
|
|
|
|
2001-06-05 02:33:19 -03:00
|
|
|
def open(file, flag = 'r', mode=0666):
|
1996-01-25 14:33:39 -04:00
|
|
|
return bsddb.hashopen(file, flag, mode)
|