From 3adb1ce05d027edf2498a88375754a56a1ef0710 Mon Sep 17 00:00:00 2001 From: Martin Mahner Date: Thu, 2 Jun 2011 21:04:15 +0200 Subject: [PATCH] Catch 'NoneType' object is not callable --- 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 fbaa2f2..804521e 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: lexer = get_lexer_by_name(lexer_name) - except ClassNotFound: + except (TypeError, ClassNotFound): logger.warning('Could not find lexer for name "%s"' % lexer_name) lexer = PythonLexer()