'Overrides Subprocess._prepare_child_fds()
The FastCGI socket needs to be set to file descriptor 0 in the child'

def _prepare_child_fds(self):

    sock_fd = self.fcgi_sock.fileno()
    options = self.config.options
    options.dup2(sock_fd, 0)
    options.dup2(self.pipes['child_stdout'], 1)
    if self.config.redirect_stderr:
        options.dup2(self.pipes['child_stdout'], 2)
    else:
        options.dup2(self.pipes['child_stderr'], 2)
    for i in range(3, options.minfds):
        options.close_fd(i)
