mercurial/ui.py
changeset 48933 78f1de3f4be7
parent 48875 6000f5b25c9b
child 48935 2cce2fa5bcf7
equal deleted inserted replaced
48932:176f1a0d15dc 48933:78f1de3f4be7
  1723         # - http://bugs.python.org/issue12833
  1723         # - http://bugs.python.org/issue12833
  1724         with self.timeblockedsection(b'stdio'):
  1724         with self.timeblockedsection(b'stdio'):
  1725             if usereadline:
  1725             if usereadline:
  1726                 self.flush()
  1726                 self.flush()
  1727                 prompt = encoding.strfromlocal(prompt)
  1727                 prompt = encoding.strfromlocal(prompt)
  1728                 line = encoding.strtolocal(pycompat.rawinput(prompt))
  1728                 line = encoding.strtolocal(input(prompt))
  1729                 # When stdin is in binary mode on Windows, it can cause
  1729                 # When stdin is in binary mode on Windows, it can cause
  1730                 # raw_input() to emit an extra trailing carriage return
  1730                 # input() to emit an extra trailing carriage return
  1731                 if pycompat.oslinesep == b'\r\n' and line.endswith(b'\r'):
  1731                 if pycompat.oslinesep == b'\r\n' and line.endswith(b'\r'):
  1732                     line = line[:-1]
  1732                     line = line[:-1]
  1733             else:
  1733             else:
  1734                 self._fout.write(pycompat.bytestr(prompt))
  1734                 self._fout.write(pycompat.bytestr(prompt))
  1735                 self._fout.flush()
  1735                 self._fout.flush()