MCPcopy Index your code
hub / github.com/python/cpython / _send

Method _send

Lib/pdb.py:3138–3149  ·  view source on GitHub ↗
(self, **kwargs)

Source from the content-addressed store, hash-verified

3136 )
3137
3138 def _send(self, **kwargs):
3139 self._ensure_valid_message(kwargs)
3140 json_payload = json.dumps(kwargs)
3141 try:
3142 self.server_socket.sendall(json_payload.encode() + b"\n")
3143 except OSError:
3144 # This means that the client has abruptly disconnected, but we'll
3145 # handle that the next time we try to read from the client instead
3146 # of trying to handle it from everywhere _send() may be called.
3147 # Track this with a flag rather than assuming readline() will ever
3148 # return an empty string because the socket may be half-closed.
3149 self.write_failed = True
3150
3151 def _readline(self):
3152 if self.sigint_received:

Callers 2

prompt_for_replyMethod · 0.95
completeMethod · 0.95

Calls 4

_ensure_valid_messageMethod · 0.95
dumpsMethod · 0.45
sendallMethod · 0.45
encodeMethod · 0.45

Tested by

no test coverage detected