diff -r 37ab2331b94c -r 5c1bb5750558 hgext/highlight.py --- a/hgext/highlight.py Thu Apr 10 14:08:38 2008 +0200 +++ b/hgext/highlight.py Thu Apr 10 14:25:50 2008 +0200 @@ -51,10 +51,10 @@ 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) - except ClassNotFound: + except (ClassNotFound, ValueError): lexer = TextLexer(encoding=util._encoding) formatter = HtmlFormatter(style=style, encoding=util._encoding)