Merge with crew-stable.
authorDirkjan Ochtman <dirkjan@ochtman.nl>
Thu, 10 Apr 2008 14:25:50 +0200
changeset 6511 5c1bb5750558
parent 6510 37ab2331b94c (current diff)
parent 6494 c30849d4c8ba (diff)
child 6512 368a4ec603cc
child 6513 66e87c11447d
Merge with crew-stable.
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)