--- a/eric6/QScintilla/Lexers/LexerRuby.py Thu Apr 15 16:52:05 2021 +0200 +++ b/eric6/QScintilla/Lexers/LexerRuby.py Thu Apr 15 18:11:24 2021 +0200 @@ -7,6 +7,8 @@ Module implementing a Ruby lexer with some additional methods. """ +import contextlib + from PyQt5.Qsci import QsciLexerRuby from .Lexer import Lexer @@ -36,11 +38,9 @@ """ Public slot to initialize the properties. """ - try: + with contextlib.suppress(AttributeError): self.setFoldCompact(Preferences.getEditor("AllFoldCompact")) self.setFoldComments(Preferences.getEditor("RubyFoldComment")) - except AttributeError: - pass def autoCompletionWordSeparators(self): """