--- a/eric6/Project/ProjectBrowserModel.py Thu Apr 15 16:52:05 2021 +0200 +++ b/eric6/Project/ProjectBrowserModel.py Thu Apr 15 18:11:24 2021 +0200 @@ -9,6 +9,7 @@ import os import re +import contextlib from PyQt5.QtCore import QDir, QModelIndex, pyqtSignal, QFileSystemWatcher, Qt from PyQt5.QtGui import QColor @@ -645,15 +646,13 @@ else: break for child in itm.children(): - try: + with contextlib.suppress(AttributeError): start, end = child.boundaries() if end == -1: end = 1000000 # assume end of file if start <= lineno <= end: itm = child break - except AttributeError: - pass else: itm = None if itm: