PY-17447 _notify_process_created() moved to PyDB as send_process_created_message() method

This commit is contained in:
Alexander Koshevoy
2016-10-18 02:57:29 +03:00
parent f43dfe6871
commit 7df98492e4
2 changed files with 10 additions and 6 deletions

View File

@@ -55,11 +55,6 @@ def _on_forked_process():
pydevd.threadingCurrentThread().__pydevd_main_thread = True
pydevd.settrace_forked()
def _notify_process_created(dbg):
if dbg is not None:
cmd = dbg.cmd_factory.make_process_created_message()
dbg.writer.add_command(cmd)
def _on_set_trace_for_new_thread(global_debugger):
if global_debugger is not None:
global_debugger.SetTrace(global_debugger.trace_dispatch)
@@ -466,7 +461,9 @@ def create_fork(original_name):
else:
if is_new_python_process:
from _pydevd_bundle.pydevd_comm import get_global_debugger
_notify_process_created(get_global_debugger())
debugger = get_global_debugger()
if debugger is not None:
debugger.send_process_created_message()
return child_process
return new_fork

View File

@@ -682,6 +682,13 @@ class PyDB:
self.process_internal_commands()
def send_process_created_message(self):
"""Sends a message that a new process has been created.
"""
cmd = self.cmd_factory.make_process_created_message()
self.writer.add_command(cmd)
def do_wait_suspend(self, thread, frame, event, arg): #@UnusedVariable
""" busy waits until the thread state changes to RUN
it expects thread's state as attributes of the thread.