eric6/QScintilla/Lexers/LexerProperties.py

changeset 8243
cc717c2ae956
parent 7923
91e843545d9a
diff -r aa713ac50c0d -r cc717c2ae956 eric6/QScintilla/Lexers/LexerProperties.py
--- 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):
         """

eric ide

mercurial