def close(self): try: self.request_handler.log_request( self.status.split(' ',1)[0], self.bytes_sent ) finally: BaseHandler.close(self)
def ignore_broken_pipes(self): """Ignores unused error message about broken pipe.""" try: ex = BrokenPipeError except NameError: ex = socket.error if sys.exc_info()[0] != ex: BaseHandler.__handle_error_original_(self)
def testAbstractMethods(self): h = BaseHandler() for name in [ '_flush','get_stdin','get_stderr','add_cgi_vars' ]: self.assertRaises(NotImplementedError, getattr(h,name)) self.assertRaises(NotImplementedError, h._write, "test")
def ignore_broken_pipes(self): # pylint: disable=protected-access if sys.version_info[0] > 2: # pylint: disable=undefined-variable if sys.exc_info()[0] != BrokenPipeError: # noqa BaseHandler.__handle_error_original_(self)
def run(self): from wsgiref.handlers import BaseHandler handler = BaseHandler() handler.run(self)