--- a/eric6/QScintilla/EditorOutlineModel.py Thu Apr 15 16:52:05 2021 +0200 +++ b/eric6/QScintilla/EditorOutlineModel.py Thu Apr 15 18:11:24 2021 +0200 @@ -8,6 +8,7 @@ """ import os +import contextlib from PyQt5.QtCore import QCoreApplication, QModelIndex @@ -106,13 +107,11 @@ # special treatment done later continue cl = dictionary[key] - try: + with contextlib.suppress(AttributeError): if cl.module == self.__module: node = BrowserClassItem( parentItem, cl, self.__filename) self._addItem(node, parentItem) - except AttributeError: - pass if ( "@@Coding@@" in keys and Preferences.getEditor("SourceOutlineShowCoding")