summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2017-03-24 22:02:20 +0100
committerJon Bergli Heier <snakebite@jvnv.net>2017-03-24 22:02:20 +0100
commit66c2af1489ec42f4674145f7e5483027af0a84c2 (patch)
treeaac719fc7fde5ff1afdf59803e4d75ac4c41a9f1
parentf140d01d3eea4c82e3ab1f10600148c4946bcbbc (diff)
Use key instead of cmp when sorting lexers.
This is considered good practice these days, and also makes the code work with python 3.
-rw-r--r--pastepy.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/pastepy.py b/pastepy.py
index 23eb40e..38c7d1a 100644
--- a/pastepy.py
+++ b/pastepy.py
@@ -55,7 +55,7 @@ class Paste(object):
rendered.append(('Rendered markdown', 'md-render'))
if len(rendered):
self.lexers.append(('Rendered', rendered))
- self.lexers.append(('Others' if settings.categories else 'Syntax', sorted(lexers.items(), cmp = lambda a, b: cmp(a[0], b[0]))))
+ self.lexers.append(('Others' if settings.categories else 'Syntax', sorted(lexers.items(), key = lambda l: l[0].lower())))
self.formatter = CustomHtmlFormatter(linenos = 'table', lineanchors = 'line', anchorlinenos = True)
random.seed()