catch exceptions from get_filetype_from_buffer

This commit is contained in:
Alan Hamlett
2015-07-29 00:03:18 -07:00
parent fd91b9e032
commit 18d87118e1
21 changed files with 322 additions and 258 deletions

View File

@@ -135,7 +135,12 @@ def guess_lexer_using_modeline(text):
lexer, accuracy = None, None
file_type = get_filetype_from_buffer(text)
file_type = None
try:
file_type = get_filetype_from_buffer(text)
except:
pass
if file_type is not None:
try:
lexer = get_lexer_by_name(file_type)