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

Method process_payload

Lib/pdb.py:3331–3350  ·  view source on GitHub ↗
(self, payload)

Source from the content-addressed store, hash-verified

3329 os.kill(self.pid, signal.SIGINT)
3330
3331 def process_payload(self, payload):
3332 match payload:
3333 case {
3334 "command_list": command_list
3335 } if all(isinstance(c, str) for c in command_list):
3336 self.pdb_commands = set(command_list)
3337 case {"message": str(msg), "type": str(msg_type)}:
3338 if msg_type == "error":
3339 print("***", msg, flush=True)
3340 else:
3341 print(msg, end="", flush=True)
3342 case {"help": str(arg)}:
3343 self.pdb_instance.do_help(arg)
3344 case {"prompt": str(prompt), "state": str(state)}:
3345 if state not in ("pdb", "interact"):
3346 state = "dumb"
3347 self.state = state
3348 self.prompt_for_reply(prompt)
3349 case _:
3350 raise RuntimeError(f"Unrecognized payload {payload}")
3351
3352 def prompt_for_reply(self, prompt):
3353 while True:

Callers 1

cmdloopMethod · 0.95

Calls 3

prompt_for_replyMethod · 0.95
setFunction · 0.85
do_helpMethod · 0.45

Tested by

no test coverage detected