comparison mercurial/ui.py @ 31778:8181f378b073

pycompat: provide bytes os.linesep
author Yuya Nishihara <yuya@tcha.org>
date Wed, 29 Mar 2017 21:23:28 +0900
parents c3ca0ad8ab9c
children ac69675fff1c
comparison
equal deleted inserted replaced
31777:7d2cbe11ae48 31778:8181f378b073
1100 sys.stdin = oldin 1100 sys.stdin = oldin
1101 sys.stdout = oldout 1101 sys.stdout = oldout
1102 1102
1103 # When stdin is in binary mode on Windows, it can cause 1103 # When stdin is in binary mode on Windows, it can cause
1104 # raw_input() to emit an extra trailing carriage return 1104 # raw_input() to emit an extra trailing carriage return
1105 if os.linesep == '\r\n' and line and line[-1] == '\r': 1105 if pycompat.oslinesep == '\r\n' and line and line[-1] == '\r':
1106 line = line[:-1] 1106 line = line[:-1]
1107 return line 1107 return line
1108 1108
1109 def prompt(self, msg, default="y"): 1109 def prompt(self, msg, default="y"):
1110 """Prompt user with msg, read response. 1110 """Prompt user with msg, read response.