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

Method _send

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

Source from the content-addressed store, hash-verified

2849 thread.start()
2850
2851 def _send(self, **kwargs):
2852 self._ensure_valid_message(kwargs)
2853 json_payload = json.dumps(kwargs)
2854 try:
2855 self._sockfile.write(json_payload.encode() + b"\n")
2856 self._sockfile.flush()
2857 except (OSError, ValueError):
2858 # We get an OSError if the network connection has dropped, and a
2859 # ValueError if detach() if the sockfile has been closed. We'll
2860 # handle this the next time we try to read from the client instead
2861 # of trying to handle it from everywhere _send() may be called.
2862 # Track this with a flag rather than assuming readline() will ever
2863 # return an empty string because the socket may be half-closed.
2864 self._write_failed = True
2865
2866 @typing.override
2867 def message(self, msg, end="\n"):

Callers 5

messageMethod · 0.95
errorMethod · 0.95
_get_inputMethod · 0.95
_read_replyMethod · 0.95
do_helpMethod · 0.95

Calls 5

_ensure_valid_messageMethod · 0.95
dumpsMethod · 0.45
writeMethod · 0.45
encodeMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected