diff -r aa713ac50c0d -r cc717c2ae956 eric6/QScintilla/Lexers/LexerPascal.py --- a/eric6/QScintilla/Lexers/LexerPascal.py Thu Apr 15 16:52:05 2021 +0200 +++ b/eric6/QScintilla/Lexers/LexerPascal.py Thu Apr 15 18:11:24 2021 +0200 @@ -7,6 +7,8 @@ Module implementing a Pascal lexer with some additional methods. """ +import contextlib + from PyQt5.Qsci import QsciLexerPascal from .Lexer import Lexer @@ -44,11 +46,9 @@ self.setFoldPreprocessor( Preferences.getEditor("PascalFoldPreprocessor")) self.setFoldCompact(Preferences.getEditor("AllFoldCompact")) - try: + with contextlib.suppress(AttributeError): self.setSmartHighlighting( Preferences.getEditor("PascalSmartHighlighting")) - except AttributeError: - pass def autoCompletionWordSeparators(self): """