diff --git a/pywb/indexer/cdxindexer.py b/pywb/indexer/cdxindexer.py index 3ce26d0d4..bcbe289a3 100644 --- a/pywb/indexer/cdxindexer.py +++ b/pywb/indexer/cdxindexer.py @@ -27,7 +27,6 @@ def json_encode(obj): from argparse import ArgumentParser, RawTextHelpFormatter -from bisect import insort from six import StringIO @@ -167,9 +166,10 @@ def write(self, entry, filename): super(SortedCDXWriter, self).write(entry, filename) line = self.out.getvalue() if line: - insort(self.sortlist, line) + self.sortlist.append(line) def __exit__(self, *args): + self.sortlist.sort() self.actual_out.write(''.join(self.sortlist)) return False