eric6/Plugins/PluginCodeStyleChecker.py

changeset 8240
93b8a353c4bf
parent 8222
5994b80b8760
diff -r 59a9a658618c -r 93b8a353c4bf eric6/Plugins/PluginCodeStyleChecker.py
--- 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):
         """

eric ide

mercurial