Catch 'NoneType' object is not callable

This commit is contained in:
Martin Mahner 2011-06-02 21:04:15 +02:00
parent 19bfd3f769
commit 3adb1ce05d

View file

@ -39,7 +39,7 @@ class NakedHtmlFormatter(HtmlFormatter):
def pygmentize(code_string, lexer_name='text'): def pygmentize(code_string, lexer_name='text'):
try: try:
lexer = get_lexer_by_name(lexer_name) lexer = get_lexer_by_name(lexer_name)
except ClassNotFound: except (TypeError, ClassNotFound):
logger.warning('Could not find lexer for name "%s"' % lexer_name) logger.warning('Could not find lexer for name "%s"' % lexer_name)
lexer = PythonLexer() lexer = PythonLexer()