eric6/DebugClients/Python/DebugClientBase.py

changeset 8240
93b8a353c4bf
parent 8230
8b5c6896655b
child 8243
cc717c2ae956
equal deleted inserted replaced
8239:59a9a658618c 8240:93b8a353c4bf
20 import signal 20 import signal
21 import time 21 import time
22 import types 22 import types
23 import importlib.util 23 import importlib.util
24 import fnmatch 24 import fnmatch
25 25 import contextlib
26 26
27 import DebugClientCapabilities 27 import DebugClientCapabilities
28 import DebugVariables 28 import DebugVariables
29 from DebugBase import setRecursionLimit, printerr # __IGNORE_WARNING__ 29 from DebugBase import setRecursionLimit, printerr # __IGNORE_WARNING__
30 from AsyncFile import AsyncFile, AsyncPendingWrite 30 from AsyncFile import AsyncFile, AsyncPendingWrite
237 Public method to close the session with the debugger and optionally 237 Public method to close the session with the debugger and optionally
238 terminate. 238 terminate.
239 239
240 @param terminate flag indicating to terminate (boolean) 240 @param terminate flag indicating to terminate (boolean)
241 """ 241 """
242 try: 242 with contextlib.suppress(Exception):
243 self.set_quit() 243 self.set_quit()
244 except Exception: # secok
245 pass
246 244
247 self.debugging = False 245 self.debugging = False
248 self.multiprocessSupport = False 246 self.multiprocessSupport = False
249 self.noDebugList = [] 247 self.noDebugList = []
250 248
1144 1142
1145 @return client capabilities (integer) 1143 @return client capabilities (integer)
1146 """ 1144 """
1147 try: 1145 try:
1148 import PyProfile # __IGNORE_WARNING__ 1146 import PyProfile # __IGNORE_WARNING__
1149 try: 1147 with contextlib.suppress(KeyError):
1150 del sys.modules['PyProfile'] 1148 del sys.modules['PyProfile']
1151 except KeyError:
1152 pass
1153 return self.clientCapabilities 1149 return self.clientCapabilities
1154 except ImportError: 1150 except ImportError:
1155 return ( 1151 return (
1156 self.clientCapabilities & ~DebugClientCapabilities.HasProfiler) 1152 self.clientCapabilities & ~DebugClientCapabilities.HasProfiler)
1157 1153

eric ide

mercurial