eric7.DebugClients.Python.MultiprocessingExtension

Module implementing a function to patch multiprocessing.Process to support debugging of the process.

Global Attributes

_debugClient
_originalBootstrap
_originalProcess

Classes

EricDefaultContext Class replacing the original 'set_start_method()' method.
ProcessWrapper Wrapper class for multiprocessing.Process.

Functions

patchMultiprocessing Function to patch the multiprocessing module.


EricDefaultContext

Class replacing the original 'set_start_method()' method.

This is done in order to prevent a script to be debugged changing the method to 'forkserver' because the debugger cannot handle this.

Derived from

module.context.DefaultContext

Class Attributes

None

Class Methods

None

Methods

get_all_start_methods Public method to get a list of supported start methods.
get_context Public method to get a context object of the given method.
set_start_method Public method to set the start method for starting new processes.

Static Methods

None

EricDefaultContext.get_all_start_methods

get_all_start_methods()

Public method to get a list of supported start methods.

Return:
list of supported start methods
Return Type:
list of str

EricDefaultContext.get_context

get_context(method=None)

Public method to get a context object of the given method.

method (str | None (optional))
start method of the new context (defaults to None)
Return:
created context object
Return Type:
BaseContext

EricDefaultContext.set_start_method

set_start_method(method, force=False)

Public method to set the start method for starting new processes.

method (str)
start method name
force (bool (optional))
flag indicating to set it even if one was set already (defaults to False)
Up


ProcessWrapper

Wrapper class for multiprocessing.Process.

Derived from

_originalProcess

Class Attributes

None

Class Methods

None

Methods

_bootstrap Wrapper around _bootstrap to start debugger.

Static Methods

None

ProcessWrapper._bootstrap

_bootstrap(*args, **kwargs)

Wrapper around _bootstrap to start debugger.

args (list)
function arguments
kwargs (dict)
keyword only arguments
Return:
exit code of the process
Return Type:
int
Up


patchMultiprocessing

patchMultiprocessing(module, debugClient)

Function to patch the multiprocessing module.

module (module)
reference to the imported module to be patched
debugClient (DebugClient)
reference to the debug client object
Up