Skip to content
Snippets Groups Projects
Commit c30849d4 authored by Benoit Allard's avatar Benoit Allard
Browse files

highlight: backward compatibility with pygments 0.5.1

parent c19c2671
No related merge requests found
......@@ -59,6 +59,6 @@
try:
lexer = guess_lexer_for_filename(fctx.path(), text,
encoding=util._encoding)
except ClassNotFound:
except (ClassNotFound, ValueError):
try:
lexer = guess_lexer(text, encoding=util._encoding)
......@@ -63,6 +63,6 @@
try:
lexer = guess_lexer(text, encoding=util._encoding)
except ClassNotFound:
except (ClassNotFound, ValueError):
lexer = TextLexer(encoding=util._encoding)
formatter = HtmlFormatter(style=style, encoding=util._encoding)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment