47 @param kwargs keyword only arguments |
47 @param kwargs keyword only arguments |
48 @type dict |
48 @type dict |
49 @return exit code of the process |
49 @return exit code of the process |
50 @rtype int |
50 @rtype int |
51 """ |
51 """ |
|
52 _debugging = False |
52 if ( |
53 if ( |
53 _debugClient.debugging and |
54 _debugClient.debugging and |
54 _debugClient.multiprocessSupport |
55 _debugClient.multiprocessSupport |
55 ): |
56 ): |
56 try: |
57 scriptName = sys.argv[0] |
57 (wd, host, port, exceptions, tracePython, redirect, |
58 if not _debugClient.skipMultiProcessDebugging(scriptName): |
58 noencoding) = _debugClient.startOptions[:7] |
59 _debugging = True |
59 _debugClient.startDebugger( |
60 try: |
60 sys.argv[0], host=host, port=port, |
61 (wd, host, port, exceptions, tracePython, redirect, |
61 exceptions=exceptions, tracePython=tracePython, |
62 noencoding) = _debugClient.startOptions[:7] |
62 redirect=redirect, passive=False, |
63 _debugClient.startDebugger( |
63 multiprocessSupport=True |
64 sys.argv[0], host=host, port=port, |
64 ) |
65 exceptions=exceptions, tracePython=tracePython, |
65 except Exception: |
66 redirect=redirect, passive=False, |
66 print("Exception during multiprocessing bootstrap init:") |
67 multiprocessSupport=True |
67 # __IGNORE_WARNING_M801__ |
68 ) |
68 traceback.print_exc(file=sys.stdout) |
69 except Exception: |
69 sys.stdout.flush() |
70 print("Exception during multiprocessing bootstrap" |
70 raise |
71 " init:") |
|
72 # __IGNORE_WARNING_M801__ |
|
73 traceback.print_exc(file=sys.stdout) |
|
74 sys.stdout.flush() |
|
75 raise |
71 |
76 |
72 exitcode = _originalBootstrap(self, *args, **kwargs) |
77 exitcode = _originalBootstrap(self, *args, **kwargs) |
73 |
78 |
74 if ( |
79 if _debugging: |
75 _debugClient.debugging and |
|
76 _debugClient.multiprocessSupport |
|
77 ): |
|
78 _debugClient.progTerminated(exitcode, "process finished") |
80 _debugClient.progTerminated(exitcode, "process finished") |
79 |
81 |
80 return exitcode |
82 return exitcode |
81 |
83 |
82 _originalProcess._bootstrap = ProcessWrapper._bootstrap |
84 _originalProcess._bootstrap = ProcessWrapper._bootstrap |