dbhash.py 420 B

12345678910111213141516
  1. """Provide a (g)dbm-compatible interface to bsddb.hashopen."""
  2. import sys
  3. try:
  4. import bsddb
  5. except ImportError:
  6. # prevent a second import of this module from spuriously succeeding
  7. del sys.modules[__name__]
  8. raise
  9. __all__ = ["error","open"]
  10. error = bsddb.error # Exported for anydbm
  11. def open(file, flag = 'r', mode=0666):
  12. return bsddb.hashopen(file, flag, mode)