# HG changeset patch # User Dirkjan Ochtman # Date 1207830350 -7200 # Node ID 5c1bb57505585347a9ef1f13b688e4933f2a22c6 # Parent 37ab2331b94c263a7e76c4ad0c3c8dce9a5e0177# Parent c30849d4c8baa4acbadaf2af8c7a5713723ffc83 Merge with crew-stable. 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)