Esempio n. 1
0
 def close(self):
     try:
         self.request_handler.log_request(
             self.status.split(' ',1)[0], self.bytes_sent
         )
     finally:
         BaseHandler.close(self)
Esempio n. 2
0
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")
Esempio n. 4
0
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)
Esempio n. 5
0
File: mnml.py Progetto: 4sp1r3/mnml
 def run(self):
     from wsgiref.handlers import BaseHandler
     handler = BaseHandler()
     handler.run(self)