Skip deprecated lexers (Pygments 2.7.3 and later)
Work around the way Pygments maintainers have decided to list "deprecated" lexers, but just skipping them if attempting to add raises an IndexError because they look like JSONBareObject here: https: //github.com/pygments/pygments/commit/5ee1754 Change-Id: Ia7b896263b4118ec369c5ce130addef3295a91a5
This commit is contained in:
parent
1970b75415
commit
69ec973e39
@ -35,7 +35,12 @@ def _get_pygments_lexers(add_empty=True):
|
||||
if add_empty:
|
||||
r.append(('', ''),)
|
||||
for lexer in get_all_lexers():
|
||||
try:
|
||||
r.append((lexer[1][0], _(lexer[0])),)
|
||||
except IndexError:
|
||||
# Skip "deprecated" lexer entries, like this in Pygments 2.7.3:
|
||||
# https://github.com/pygments/pygments/commit/5ee1754
|
||||
continue
|
||||
return r
|
||||
|
||||
|
||||
|
@ -2,7 +2,7 @@ six
|
||||
Jinja2
|
||||
Werkzeug<0.16
|
||||
Pygments<2.6;python_version<'3'
|
||||
Pygments<2.7.3;python_version>='3'
|
||||
Pygments;python_version>='3'
|
||||
SQLAlchemy
|
||||
PyMySQL
|
||||
simplejson
|
||||
|
Loading…
x
Reference in New Issue
Block a user