From 7083170bb9e3149a71425e7ed61f0cf8c8a02892 Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Sun, 15 Aug 2021 19:20:37 +0200 Subject: Handle lexers without an alias --- pastepy/pastepy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pastepy') diff --git a/pastepy/pastepy.py b/pastepy/pastepy.py index ca113c0..9b86d17 100644 --- a/pastepy/pastepy.py +++ b/pastepy/pastepy.py @@ -34,7 +34,7 @@ class CustomHtmlFormatter(HtmlFormatter): yield 0, '' def init_lexers(): - all_lexers = dict([(x[0], x[1][0]) for x in get_all_lexers()]) + all_lexers = dict([(x[0], x[1][0] if x[1] else x[0]) for x in get_all_lexers()]) lexers = [] removed = [] for cat, ls in current_app.config['CATEGORIES']: -- cgit v1.2.3