--- a/eric6/Plugins/PluginCodeStyleChecker.py Wed Apr 14 19:38:19 2021 +0200 +++ b/eric6/Plugins/PluginCodeStyleChecker.py Wed Apr 14 19:59:16 2021 +0200 @@ -9,6 +9,7 @@ import os import textwrap +import contextlib from PyQt5.QtCore import QObject, pyqtSignal, QCoreApplication @@ -417,10 +418,8 @@ @param editor reference to the editor (QScintilla.Editor) """ - try: + with contextlib.suppress(ValueError): self.__editors.remove(editor) - except ValueError: - pass def __editorShowMenu(self, menuName, menu, editor): """