Skip to content

Commit

Permalink
Merge pull request #42 from zopefoundation/fix_sort_iterate_resultset
Browse files Browse the repository at this point in the history
fix sorting in _sort_iterate_resultset in py3
  • Loading branch information
pbauer committed Sep 24, 2018
2 parents f945eb9 + 0fb158b commit ec78801
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES.rst
Expand Up @@ -7,6 +7,8 @@ Changelog
- Adapt the ZMI HTML to the new Bootstrap ZMI.
(`#41 <https://github.com/zopefoundation/Products.ZCatalog/pull/41>`_)

- Fix sorting in _sort_iterate_resultset in python 3.
(`#42 <https://github.com/zopefoundation/Products.ZCatalog/pull/42>`_)

4.1.1 (2018-07-05)
------------------
Expand Down
5 changes: 4 additions & 1 deletion src/Products/ZCatalog/Catalog.py
Expand Up @@ -791,7 +791,10 @@ def _sort_iterate_resultset(self, actual_result_count, result, rs,
# the cost of instantiating a LazyMap per result
result.append((key, did, self.__getitem__))
if merge:
result.sort(reverse=reverse)
result = sorted(
result,
key=lambda x: (0,) if x[0] is None else x,
reverse=reverse)
else:
for did in rs:
try:
Expand Down

0 comments on commit ec78801

Please sign in to comment.