1996-01-26 02:33:39 +08:00
|
|
|
"""Provide a (g)dbm-compatible interface to bsdhash.hashopen."""
|
|
|
|
|
2001-01-25 21:47:00 +08:00
|
|
|
import sys
|
|
|
|
try:
|
|
|
|
import bsddb
|
|
|
|
except ImportError:
|
|
|
|
# prevent a second import of this module from spuriously succeeding
|
|
|
|
del sys.modules[__name__]
|
|
|
|
raise
|
1996-01-26 02:33:39 +08:00
|
|
|
|
2001-01-21 03:54:20 +08:00
|
|
|
__all__ = ["error","open"]
|
|
|
|
|
1999-05-04 02:09:26 +08:00
|
|
|
error = bsddb.error # Exported for anydbm
|
1996-01-26 02:33:39 +08:00
|
|
|
|
2001-06-05 13:33:19 +08:00
|
|
|
def open(file, flag = 'r', mode=0666):
|
1996-01-26 02:33:39 +08:00
|
|
|
return bsddb.hashopen(file, flag, mode)
|