Skip to content

Commit

Permalink
Stick with getitem/except KeyError approach for sort indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
hannosch committed Apr 7, 2012
1 parent fc608f2 commit 6257477
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Products/ZCatalog/Catalog.py
Expand Up @@ -769,7 +769,10 @@ def sortResults(self, rs, sort_index, reverse=False, limit=None,
# sort on secondary index
keysets = defaultdict(list)
for i in intset:
keysets[(k, index2_key_map.get(i))].append(i)
try:
keysets[(k, index2_key_map[i])].append(i)
except KeyError:
pass
for k2, v2 in keysets.items():
append((k2, v2, _self__getitem__))
result = multisort(result, sort_spec)
Expand Down

0 comments on commit 6257477

Please sign in to comment.