diff --git a/sktools/src/sktools/common.py b/sktools/src/sktools/common.py index 8e3aa313..15610dae 100644 --- a/sktools/src/sktools/common.py +++ b/sktools/src/sktools/common.py @@ -528,11 +528,12 @@ def is_shelf_file_matching(shelf_file, mydict): db = shelve.open(shelf_file, 'r') except dbm.error: return False - if not type(db) is type(mydict): - return False match = True for key in mydict: - match = key in db and db[key] == mydict[key] + try: + match = key in db and db[key] == mydict[key] + except KeyError: + match = False if not match: return False return True