# HG changeset patch # User Benoit Allard # Date 1207830267 -7200 # Node ID c30849d4c8baa4acbadaf2af8c7a5713723ffc83 # Parent c19c26718d22fb1988e77543a47d90fd7e222466 highlight: backward compatibility with pygments 0.5.1 diff -r c19c26718d22 -r c30849d4c8ba hgext/highlight.py --- a/hgext/highlight.py Tue Apr 08 18:39:02 2008 +0200 +++ b/hgext/highlight.py Thu Apr 10 14:24:27 2008 +0200 @@ -59,10 +59,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)