--- a/eric6/QScintilla/Lexers/LexerProperties.py Thu Apr 15 16:52:05 2021 +0200 +++ b/eric6/QScintilla/Lexers/LexerProperties.py Thu Apr 15 18:11:24 2021 +0200 @@ -7,6 +7,8 @@ Module implementing a Properties lexer with some additional methods. """ +import contextlib + from PyQt5.Qsci import QsciLexerProperties from .Lexer import Lexer @@ -35,11 +37,9 @@ Public slot to initialize the properties. """ self.setFoldCompact(Preferences.getEditor("AllFoldCompact")) - try: + with contextlib.suppress(AttributeError): self.setInitialSpaces( Preferences.getEditor("PropertiesInitialSpaces")) - except AttributeError: - pass def isCommentStyle(self, style): """