eric7/QScintilla/Lexers/LexerPygments.py

branch
eric7
changeset 8407
d6f374ab42eb
parent 8318
962bce857696
child 8881
54e42bc2437a
diff -r 45d7d0eec4d3 -r d6f374ab42eb eric7/QScintilla/Lexers/LexerPygments.py
--- a/eric7/QScintilla/Lexers/LexerPygments.py	Fri Jun 04 18:50:01 2021 +0200
+++ b/eric7/QScintilla/Lexers/LexerPygments.py	Sun Jun 06 15:24:44 2021 +0200
@@ -455,12 +455,12 @@
             if self.editor is not None:
                 fn = self.editor.getFileName()
                 if fn:
-                    with contextlib.suppress(ClassNotFound):
+                    with contextlib.suppress(ClassNotFound, AttributeError):
                         lexer = guess_lexer_for_filename(fn, text)
             
             # step 2: guess on text only
             if lexer is None:
-                with contextlib.suppress(ClassNotFound):
+                with contextlib.suppress(ClassNotFound, AttributeError):
                     lexer = guess_lexer(text)
         
         return lexer

eric ide

mercurial