diff --git a/ostap/io/compress_shelve.py b/ostap/io/compress_shelve.py index 2df3316c..dbec81f5 100755 --- a/ostap/io/compress_shelve.py +++ b/ostap/io/compress_shelve.py @@ -246,7 +246,7 @@ def __init__( self.__opened = False dbase = dbopen ( self.dbname , flag = mode , dbtype = dbtype , **kwargs ) self.__opened = True - if dbase and 'r' != mode and hasattr ( dbase , 'sync' ) : dbase.sync() + if 'r' != mode and hasattr ( dbase , 'sync' ) : dbase.sync() # ======================================================================= ## all files after dbopen @@ -269,6 +269,7 @@ def __init__( # ====================================================================== ## actual type of underlying database self.__dbtype = whichdb ( self.dbname ) ## actual dbtype + if not self.dbtype : logger.error ( 'Type of DB is no determined!' ) # ====================================================================== ## expected files for the given DB type diff --git a/ostap/io/tests/test_io_shelves.py b/ostap/io/tests/test_io_shelves.py index c27085a0..73e23a07 100755 --- a/ostap/io/tests/test_io_shelves.py +++ b/ostap/io/tests/test_io_shelves.py @@ -172,6 +172,11 @@ def test_shelves1(): 'sqlite' , 'sqlite3' , 'dbm.gnu' , + 'dbm.ndbm' , + 'dbm.dumb' , + 'dbhash' , + 'dbm' , + 'gdbm' , 'dumbdbm' , 'std' , ]