changeset 6511:5c1bb5750558

Merge with crew-stable.
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Thu, 10 Apr 2008 14:25:50 +0200
parents 37ab2331b94c (current diff) c30849d4c8ba (diff)
children 368a4ec603cc 66e87c11447d
files hgext/highlight.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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)