code: def push(self, line, frame, buffer_output=True):
          
          self.__buffer_output = buffer_output
          more = False
          if buffer_output:
              original_stdout = sys.stdout
              original_stderr = sys.stderr
          try:
              try:
                  self.frame = frame
                  if buffer_output:
                      out = sys.stdout = IOBuf()
                      err = sys.stderr = IOBuf()
                  more = self.add_exec(line)
              except Exception:
                  exc = get_exception_traceback_str()
                  if buffer_output:
                      err.buflist.append("Internal Error: %s" % (exc,))
                  else:
                      sys.stderr.write("Internal Error: %s\n" % (exc,))
          finally:
              #Remove frame references.
              self.frame = None
              frame = None
              if buffer_output:
                  sys.stdout = original_stdout
                  sys.stderr = original_stderr
  
          if buffer_output:
              return more, out.buflist, err.buflist
          else:
              return more, [], []
docs: Change built-in stdout and stderr methods by the
          new custom StdMessage.
          execute the InteractiveConsole.push.
          Change the stdout and stderr back be the original built-ins
  
          :param buffer_output: if False won't redirect the output.
  
          Return boolean (True if more input is required else False),
          output_messages and input_messages