mirror of
https://github.com/microsoft/debugpy.git
synced 2025-12-23 08:48:12 +00:00
Moved disconnect fix from messaging to Client.disconnect_request
This commit is contained in:
parent
cc6b2499b2
commit
d937dff0fd
2 changed files with 6 additions and 8 deletions
|
|
@ -700,6 +700,12 @@ class Client(components.Component):
|
|||
except Exception:
|
||||
log.swallow_exception()
|
||||
|
||||
# Close the client channel since we disconnected from the client.
|
||||
try:
|
||||
self.channel.close()
|
||||
except Exception:
|
||||
log.swallow_exception(level="warning")
|
||||
|
||||
def disconnect(self):
|
||||
super().disconnect()
|
||||
|
||||
|
|
|
|||
|
|
@ -1223,14 +1223,6 @@ class JsonMessageChannel(object):
|
|||
yield seq
|
||||
self.stream.write_json(message)
|
||||
|
||||
# Close connection after Debugpy acknowledges a disconnect request.
|
||||
if (
|
||||
message.get("type") == "response"
|
||||
and message.get("command") == "disconnect"
|
||||
and message.get("success", False)
|
||||
):
|
||||
self.stream.close()
|
||||
|
||||
def send_request(self, command, arguments=None, on_before_send=None):
|
||||
"""Sends a new request, and returns the OutgoingRequest object for it.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue