Correct exception

This commit is contained in:
Martin Mahner 2011-06-01 12:45:53 +00:00
parent 504fcc4369
commit b192fb1b09

View file

@ -39,8 +39,7 @@ class NakedHtmlFormatter(HtmlFormatter):
def pygmentize(code_string, lexer_name='text'): def pygmentize(code_string, lexer_name='text'):
try: try:
return highlight(code_string, get_lexer_by_name(lexer_name), NakedHtmlFormatter()) return highlight(code_string, get_lexer_by_name(lexer_name), NakedHtmlFormatter())
except TypeError: except AttributeError:
logger.critical('Highlight failed with lexter %s' % lexer_name)
return code_string return code_string
def guess_code_lexer(code_string, default_lexer='unknown'): def guess_code_lexer(code_string, default_lexer='unknown'):