diff --git a/index/README.txt b/index/README.txt index 77a6626..416104b 100644 --- a/index/README.txt +++ b/index/README.txt @@ -62,5 +62,5 @@ Index entries that are present in the stored dictionaries must always match: >>> registry[('edit.html', None, None, 'Custom')] = 'edit.html for Custom skin' - >>> registry.get(('edit.html', 'task', 'bugfixes', '')) is None + >>> registry.get(('edit.html', 'task', 'bugfixes')) is None True diff --git a/index/multikey.py b/index/multikey.py index d0fd80d..dcad5c8 100644 --- a/index/multikey.py +++ b/index/multikey.py @@ -68,8 +68,9 @@ class MultiKeyDict(dict): for r in rList: skip = False for nx, kx in enumerate(r[0]): - if kx and kx != key[nx]: # if stored key elements are present - skip = True # they must match + # if stored key elements are present they must match + if kx and (len(key) <= nx or kx != key[nx]): + skip = True break if skip: continue