blob: ad94ed8efa1db35bb3b5bbd67449878d22f1c016 [file] [log] [blame]
Guido van Rossum67001421996-01-25 18:33:39 +00001"""Provide a (g)dbm-compatible interface to bsdhash.hashopen."""
2
Skip Montanaro438bb942001-01-25 13:47:00 +00003import sys
4try:
5 import bsddb
6except ImportError:
7 # prevent a second import of this module from spuriously succeeding
8 del sys.modules[__name__]
9 raise
Guido van Rossum67001421996-01-25 18:33:39 +000010
Skip Montanaroe99d5ea2001-01-20 19:54:20 +000011__all__ = ["error","open"]
12
Guido van Rossum287b3991999-05-03 18:09:26 +000013error = bsddb.error # Exported for anydbm
Guido van Rossum67001421996-01-25 18:33:39 +000014
Guido van Rossum9f2b5241998-07-03 14:16:55 +000015def open(file, flag, mode=0666):
Guido van Rossum67001421996-01-25 18:33:39 +000016 return bsddb.hashopen(file, flag, mode)