diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2017-03-24 22:02:20 +0100 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2017-03-24 22:02:20 +0100 |
commit | 66c2af1489ec42f4674145f7e5483027af0a84c2 (patch) | |
tree | aac719fc7fde5ff1afdf59803e4d75ac4c41a9f1 | |
parent | f140d01d3eea4c82e3ab1f10600148c4946bcbbc (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.py | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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() |