'Wait for child to finish, ignoring EINTR.'

def wait(self, child):

    while True:
        try:
            child.wait()
            return
        except OSError as e:
            if (e.errno != errno.EINTR):
                raise
