blob: 9f8a9c3f28bb27e1d67a8bb8c3253feb31ecb894 [file] [log] [blame]
Skip Montanaro581c3672003-05-05 14:16:41 +00001"""Provide a (g)dbm-compatible interface to bsddb.hashopen."""
Guido van Rossum67001421996-01-25 18:33:39 +00002
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
Martin v. Löwise24fef02001-06-05 05:33:19 +000015def open(file, flag = 'r', mode=0666):
Guido van Rossum67001421996-01-25 18:33:39 +000016 return bsddb.hashopen(file, flag, mode)