(self)
Run the server forever
Run the server forever
Run the server forever
def serve_forever(self):
        '''
        Run the server forever
        '''
        self.stop_event = threading.Event()
        process.current_process()._manager_server = self
        try:
            accepter = threading.Thread(target=self.accepter)
            accepter.daemon = True
            accepter.start()
            try:
                while not self.stop_event.is_set():
                    self.stop_event.wait(1)
            except (KeyboardInterrupt, SystemExit):
                pass
        finally:
            if sys.stdout != sys.__stdout__: # what about stderr?
                util.debug('resetting stdout, stderr')
                sys.stdout = sys.__stdout__
                sys.stderr = sys.__stderr__
            sys.exit(0)
def serve_forever ( self ) : self . stop_event = threading . Event ( ) process . current_process ( ) . _manager_server = self try : accepter = threading . Thread ( target = self . accepter ) accepter . daemon = True accepter . start ( ) try : while not self . stop_event . is_set ( ) : self . stop_event . wait ( 1 ) except ( KeyboardInterrupt , SystemExit ) : pass finally : if sys . stdout != sys . __stdout__ : # what about stderr? util . debug ( 'resetting stdout, stderr' ) sys . stdout = sys . __stdout__ sys . stderr = sys . __stderr__ sys . exit ( 0 )