Skip to content

Commit 87cf4c5

Browse files
Fix for pygments 1.6rc.
See also: encode/django-rest-framework#581
1 parent 6df2d07 commit 87cf4c5

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

snippets/models.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
from pygments.formatters import HtmlFormatter
55
from pygments import highlight
66

7-
LANGUAGE_CHOICES = sorted([(item[1][0], item[0]) for item in get_all_lexers()])
8-
STYLE_CHOICES = sorted((item, item) for item in list(get_all_styles()))
7+
LEXERS = [item for item in get_all_lexers() if item[1]]
8+
LANGUAGE_CHOICES = sorted([(item[1][0], item[0]) for item in LEXERS])
9+
STYLE_CHOICES = sorted((item, item) for item in get_all_styles())
910

1011

1112
class Snippet(models.Model):

0 commit comments

Comments
 (0)