--- a/eric6/QScintilla/Lexers/LexerSQL.py Thu Apr 15 16:52:05 2021 +0200 +++ b/eric6/QScintilla/Lexers/LexerSQL.py Thu Apr 15 18:11:24 2021 +0200 @@ -7,6 +7,8 @@ Module implementing a SQL lexer with some additional methods. """ +import contextlib + from PyQt5.Qsci import QsciLexerSQL from .Lexer import Lexer @@ -46,15 +48,13 @@ self.setFoldComments(Preferences.getEditor("SqlFoldComment")) self.setBackslashEscapes(Preferences.getEditor("SqlBackslashEscapes")) self.setFoldCompact(Preferences.getEditor("AllFoldCompact")) - try: + with contextlib.suppress(AttributeError): self.setDottedWords(Preferences.getEditor("SqlDottedWords")) self.setFoldAtElse(Preferences.getEditor("SqlFoldAtElse")) self.setFoldOnlyBegin(Preferences.getEditor("SqlFoldOnlyBegin")) self.setHashComments(Preferences.getEditor("SqlHashComments")) self.setQuotedIdentifiers( Preferences.getEditor("SqlQuotedIdentifiers")) - except AttributeError: - pass def isCommentStyle(self, style): """