Try to get current process ready to unpickle process object
(data)
| 210 | old_main_modules = [] |
| 211 | |
| 212 | def prepare(data): |
| 213 | ''' |
| 214 | Try to get current process ready to unpickle process object |
| 215 | ''' |
| 216 | if 'name' in data: |
| 217 | process.current_process().name = data['name'] |
| 218 | |
| 219 | if 'authkey' in data: |
| 220 | process.current_process().authkey = data['authkey'] |
| 221 | |
| 222 | if 'log_to_stderr' in data and data['log_to_stderr']: |
| 223 | util.log_to_stderr() |
| 224 | |
| 225 | if 'log_level' in data: |
| 226 | util.get_logger().setLevel(data['log_level']) |
| 227 | |
| 228 | if 'sys_path' in data: |
| 229 | sys.path = data['sys_path'] |
| 230 | |
| 231 | if 'sys_argv' in data: |
| 232 | sys.argv = data['sys_argv'] |
| 233 | |
| 234 | if 'dir' in data: |
| 235 | os.chdir(data['dir']) |
| 236 | |
| 237 | if 'orig_dir' in data: |
| 238 | process.ORIGINAL_DIR = data['orig_dir'] |
| 239 | |
| 240 | if 'start_method' in data: |
| 241 | set_start_method(data['start_method'], force=True) |
| 242 | |
| 243 | if 'init_main_from_name' in data: |
| 244 | _fixup_main_from_name(data['init_main_from_name']) |
| 245 | elif 'init_main_from_path' in data: |
| 246 | _fixup_main_from_path(data['init_main_from_path']) |
| 247 | |
| 248 | # Multiprocessing module helpers to fix up the main module in |
| 249 | # spawned subprocesses |
no test coverage detected
searching dependent graphs…