From b192fb1b09bc88694f06fb4ffc3cd820e4fca2a0 Mon Sep 17 00:00:00 2001 From: Martin Mahner Date: Wed, 1 Jun 2011 12:45:53 +0000 Subject: [PATCH] Correct exception --- pastebin/apps/dpaste/highlight.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pastebin/apps/dpaste/highlight.py b/pastebin/apps/dpaste/highlight.py index 166bc1e..c8ab1ff 100644 --- a/pastebin/apps/dpaste/highlight.py +++ b/pastebin/apps/dpaste/highlight.py @@ -39,8 +39,7 @@ class NakedHtmlFormatter(HtmlFormatter): def pygmentize(code_string, lexer_name='text'): try: return highlight(code_string, get_lexer_by_name(lexer_name), NakedHtmlFormatter()) - except TypeError: - logger.critical('Highlight failed with lexter %s' % lexer_name) + except AttributeError: return code_string def guess_code_lexer(code_string, default_lexer='unknown'):