--- 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 (