def _DisablePager(self):
    """Disables the pager."""
    try:
      self._connection.child.send('\r')
      self._connection.child.expect(r'\r\n',
                                    timeout=self.timeout_connect)
      self._connection.child.expect(self._connection.re_prompt,
                                    timeout=self.timeout_connect,
                                    searchwindowsize=128)
      self._connection.child.send('terminal length 0\r')
      pindex = self._connection.child.expect(
          [self._connection.re_prompt, r'Command authorization failed\.'],
          timeout=self.timeout_connect)
      if pindex == 1:
        self.connected = False
        raise exceptions.ConnectError('terminal length 0 command denied.')
      # Pause momentarily to avoid a TAC+ packet drop. See b/1890881.
      time.sleep(0.5)
    except (pexpect.EOF, pexpect.TIMEOUT) as e:
      self.connected = False
      raise exceptions.ConnectError('%s: %s' % (e.__class__, str(e)))
    logging.debug('terminal length set to 0')
dataset/ETHPy150Open google/capirca/tools/ldpush/ios.py/IosDevice._DisablePager/original