src/eric7/RemoteServer/EricServerDebuggerRequestHandler.py

branch
eric7
changeset 10961
7bbf95f41266
parent 10957
fbd61fd3fdc1
child 10962
b56b76c0221b
equal deleted inserted replaced
10960:8b23bcae1f81 10961:7bbf95f41266
197 break 197 break
198 else: 198 else:
199 if sock in self.__pendingConnections: 199 if sock in self.__pendingConnections:
200 self.__pendingConnections.remove(sock) 200 self.__pendingConnections.remove(sock)
201 201
202 sock.close() 202 with contextlib.suppress(OSError):
203 sock.close()
203 204
204 def __mainClientExited(self): 205 def __mainClientExited(self):
205 """ 206 """
206 Private method to handle exiting of the main debug client. 207 Private method to handle exiting of the main debug client.
207 """ 208 """
244 @param debuggerId ID of the debugger the socket belongs to 245 @param debuggerId ID of the debugger the socket belongs to
245 @type str 246 @type str
246 @param sock reference to the socket 247 @param sock reference to the socket
247 @type socket.socket 248 @type socket.socket
248 """ 249 """
249 with contextlib.suppress(KeyError): 250 with contextlib.suppress(KeyError, OSError):
250 # Socket might have been unregister automatically (e.g. due to a crash of 251 # Socket might have been unregister automatically (e.g. due to a crash of
251 # the script being debugged). 252 # the script being debugged).
252 self._server.getSelector().unregister(sock) 253 self._server.getSelector().unregister(sock)
253 sock.shutdown(socket.SHUT_RDWR) 254 sock.shutdown(socket.SHUT_RDWR)
254 sock.close() 255 sock.close()
255 256
256 if debuggerId: 257 if debuggerId:
257 self._server.sendJson( 258 self._server.sendJson(
258 category=EricRequestCategory.Debugger, 259 category=EricRequestCategory.Debugger,
259 reply="DebugClientDisconnected", 260 reply="DebugClientDisconnected",

eric ide

mercurial