def _pre_loop_setup(self, message):
    response = self._send_and_expect(message, message.ConfigRequest, [message.ConfigSending, message.Stop])
    if (response.cmd == message.Stop):
        print('Stop message received, child exits.')
        os._exit(0)
    pool_cfg = response.data[0]
    for (idx, cfg) in enumerate(response.data):
        try:
            cfg.parent = response.data[(idx + 1)]
        except IndexError:
            break
    self._pool_cfg = pool_cfg
    for sig in self._pool_cfg.abort_signals:
        signal.signal(sig, self._handle_abort)
    pool_metadata = response.sender_metadata
    if (self.runpath is None):
        if (pool_metadata.get('runpath') is None):
            raise RuntimeError('runpath was not set in pool metadata')
        self.runpath = pool_metadata['runpath']
    self._setup_logfiles()
def _pre_loop_setup(self, message):
    response = self._send_and_expect(message, message.ConfigRequest, [message.ConfigSending, message.Stop])
    if (response.cmd == message.Stop):
        print('Stop message received, child exits.')
        os._exit(0)
    pool_cfg = response.data[0]
    for (idx, cfg) in enumerate(response.data):
        try:
            cfg.parent = response.data[(idx + 1)]
        except IndexError:
            break
    self._pool_cfg = pool_cfg
    for sig in self._pool_cfg.abort_signals:
        signal.signal(sig, self._handle_abort)
    pool_metadata = response.sender_metadata
    if (self.runpath is None):
        if (pool_metadata.get('runpath') is None):
            raise RuntimeError('runpath was not set in pool metadata')
        self.runpath = pool_metadata['runpath']
    self._setup_logfiles()