mirror of
https://github.com/DarrenOfficial/dpaste.git
synced 2024-11-15 16:12:51 +11:00
More correct exception
This commit is contained in:
parent
b192fb1b09
commit
d040f2959d
1 changed files with 1 additions and 1 deletions
|
@ -39,7 +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 AttributeError:
|
except TypeError:
|
||||||
return code_string
|
return code_string
|
||||||
|
|
||||||
def guess_code_lexer(code_string, default_lexer='unknown'):
|
def guess_code_lexer(code_string, default_lexer='unknown'):
|
||||||
|
|
Loading…
Reference in a new issue