'Wait until the HTTP server is ready to receive requests.'

def wait(self):

    while (not getattr(self.httpserver, 'ready', False)):
        if self.interrupt:
            raise self.interrupt
        time.sleep(0.1)
    if isinstance(self.bind_addr, tuple):
        (host, port) = self.bind_addr
        wait_for_occupied_port(host, port)
