prevent using lexer when None
This commit is contained in:
parent
d6faae47d0
commit
9744df5391
1 changed files with 1 additions and 1 deletions
|
@ -36,7 +36,7 @@ def guess_language(file_name):
|
||||||
|
|
||||||
language = get_language_from_extension(file_name)
|
language = get_language_from_extension(file_name)
|
||||||
lexer = smart_guess_lexer(file_name)
|
lexer = smart_guess_lexer(file_name)
|
||||||
if language is None:
|
if language is None and lexer is not None:
|
||||||
language = u(lexer.name)
|
language = u(lexer.name)
|
||||||
|
|
||||||
return language, lexer
|
return language, lexer
|
||||||
|
|
Loading…
Reference in a new issue