code: def handle_connection_exec(client):
      
      class ExitExecLoop(Exception):
          pass
  
      def exit():
          raise ExitExecLoop()
  
      client.settimeout(None)
      fh = os.fdopen(client.detach() if hasattr(client, 'detach') else client.fileno())
  
      with closing(client):
          with closing(fh):
              try:
                  payload = fh.readline()
                  while payload:
                      _LOG("Running: %r." % payload)
                      eval(compile(payload, '<manhole>', 'exec'), {'exit': exit}, _MANHOLE.locals)
                      payload = fh.readline()
              except ExitExecLoop:
                  _LOG("Exiting exec loop.")
docs: Alternate connection handler. No output redirection.