--- a/eric6/QScintilla/Lexers/LexerTCL.py Thu Apr 15 16:52:05 2021 +0200 +++ b/eric6/QScintilla/Lexers/LexerTCL.py Thu Apr 15 18:11:24 2021 +0200 @@ -7,6 +7,8 @@ Module implementing a TCL/Tk lexer with some additional methods. """ +import contextlib + from PyQt5.Qsci import QsciLexerTCL from .Lexer import Lexer @@ -45,14 +47,10 @@ """ Public slot to initialize the properties. """ - try: + with contextlib.suppress(AttributeError): self.setFoldCompact(Preferences.getEditor("AllFoldCompact")) - except AttributeError: - pass - try: + with contextlib.suppress(AttributeError): self.setFoldComments(Preferences.getEditor("TclFoldComment")) - except AttributeError: - pass def isCommentStyle(self, style): """