From 2e866b7cdc05b3fe3040d04bd08b373767ecdab9 Mon Sep 17 00:00:00 2001 From: Tammo van der Heide Date: Tue, 20 Aug 2024 20:53:50 +0200 Subject: [PATCH] Fix shelf search bug --- sktools/src/sktools/common.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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