eric6/DebugClients/Python/DebugClientBase.py

changeset 8240
93b8a353c4bf
parent 8230
8b5c6896655b
child 8243
cc717c2ae956
diff -r 59a9a658618c -r 93b8a353c4bf eric6/DebugClients/Python/DebugClientBase.py
--- a/eric6/DebugClients/Python/DebugClientBase.py	Wed Apr 14 19:38:19 2021 +0200
+++ b/eric6/DebugClients/Python/DebugClientBase.py	Wed Apr 14 19:59:16 2021 +0200
@@ -22,7 +22,7 @@
 import types
 import importlib.util
 import fnmatch
-
+import contextlib
 
 import DebugClientCapabilities
 import DebugVariables
@@ -239,10 +239,8 @@
         
         @param terminate flag indicating to terminate (boolean)
         """
-        try:
+        with contextlib.suppress(Exception):
             self.set_quit()
-        except Exception:       # secok
-            pass
 
         self.debugging = False
         self.multiprocessSupport = False
@@ -1146,10 +1144,8 @@
         """
         try:
             import PyProfile    # __IGNORE_WARNING__
-            try:
+            with contextlib.suppress(KeyError):
                 del sys.modules['PyProfile']
-            except KeyError:
-                pass
             return self.clientCapabilities
         except ImportError:
             return (

eric ide

mercurial