'Wait until child process terminates'

def join(self, timeout=None):

    assert (self._parent_pid == os.getpid()), 'can    only    join    a    child    process'
    assert (self._popen is not None), 'can    only    join    a    started    process'
    res = self._popen.wait(timeout)
    if (res is not None):
        _current_process._children.discard(self)
