From 1876d561907aee08c22dcbd58bdc31f02247e6cb Mon Sep 17 00:00:00 2001 From: Julio Biason Date: Fri, 6 Mar 2020 13:06:08 -0300 Subject: [PATCH] Fix index generator for Python3 --- makeidx.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/makeidx.py b/makeidx.py index 62d4d0f..e0592a1 100644 --- a/makeidx.py +++ b/makeidx.py @@ -98,9 +98,8 @@ def main(): # only files in the current directly will be checked continue - content = check_presentations(files) - # holy shit, talk about abusing Python internals - content.sort(cmp=lambda x, y: -1 if x['title'] < y['title'] else 1) + content = sorted(check_presentations(files), + key=lambda r: r['title']) with open('index.json', 'w') as output: output.write(json.dumps(content))