]> arthur.barton.de Git - bup.git/commit
merge_iter: don't compare generators with < via heapq
authorRob Browning <rlb@defaultvalue.org>
Fri, 18 Oct 2019 04:22:59 +0000 (23:22 -0500)
committerRob Browning <rlb@defaultvalue.org>
Sun, 15 Dec 2019 20:59:15 +0000 (14:59 -0600)
commit187d9a2ed9e1196965f540f8fb569752b277bc78
tree19afb3aa978eb03dd4927ea193f877e58b5e5137
parentd87a9fadca4fddb8fd40299c62567bf192572122
merge_iter: don't compare generators with < via heapq

Previously we were implicitly comparing (entry, reader_generator) with
"<" in the merge_iter heapq.  In python 2, the generators would just
compare as pointers, which was fine, because we only cared about the
ordering of the initial entries.

However, in Python 3 comparing generators provokes a TypeError, so
create a trivial helper class that can carry the two items, but only
compare the entries via the < operator.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/helpers.py