MCPcopy Create free account
hub / github.com/fabioz/PyDev.Debugger / send_process_about_to_be_replaced

Method send_process_about_to_be_replaced

pydevd.py:2034–2057  ·  view source on GitHub ↗

Sends a message that a new process has been created.

(self)

Source from the content-addressed store, hash-verified

2032 self.writer.add_command(cmd)
2033
2034 def send_process_about_to_be_replaced(self):
2035 """Sends a message that a new process has been created."""
2036 if self.writer is None or self.cmd_factory is None:
2037 return
2038 cmd = self.cmd_factory.make_process_about_to_be_replaced_message()
2039 if cmd is NULL_NET_COMMAND:
2040 return
2041
2042 sent = [False]
2043
2044 def after_sent(*args, **kwargs):
2045 sent[0] = True
2046
2047 cmd.call_after_send(after_sent)
2048 self.writer.add_command(cmd)
2049
2050 timeout = 5 # Wait up to 5 seconds
2051 initial_time = time.time()
2052 while not sent[0]:
2053 time.sleep(0.05)
2054
2055 if (time.time() - initial_time) > timeout:
2056 pydev_log.critical("pydevd: Sending message related to process being replaced timed-out after %s seconds", timeout)
2057 break
2058
2059 def set_next_statement(self, frame, event, func_name, next_line):
2060 stop = False

Callers 1

Calls 3

call_after_sendMethod · 0.45
add_commandMethod · 0.45

Tested by

no test coverage detected