From d040f2959d84866de41842e4f8b245364d955b94 Mon Sep 17 00:00:00 2001 From: Martin Mahner Date: Wed, 1 Jun 2011 13:42:07 +0000 Subject: [PATCH] More correct exception --- pastebin/apps/dpaste/highlight.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pastebin/apps/dpaste/highlight.py b/pastebin/apps/dpaste/highlight.py index c8ab1ff..55a718b 100644 --- a/pastebin/apps/dpaste/highlight.py +++ b/pastebin/apps/dpaste/highlight.py @@ -39,7 +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 AttributeError: + except TypeError: return code_string def guess_code_lexer(code_string, default_lexer='unknown'):