##// END OF EJS Templates
ui: adjust Windows workaround to new _readline() code...
Yuya Nishihara -
r36814:aa0fc127 default
parent child Browse files
Show More
@@ -1286,6 +1286,10 class ui(object):
1286 with self.timeblockedsection('stdio'):
1286 with self.timeblockedsection('stdio'):
1287 if usereadline:
1287 if usereadline:
1288 line = encoding.strtolocal(pycompat.rawinput(r' '))
1288 line = encoding.strtolocal(pycompat.rawinput(r' '))
1289 # When stdin is in binary mode on Windows, it can cause
1290 # raw_input() to emit an extra trailing carriage return
1291 if pycompat.oslinesep == b'\r\n' and line.endswith(b'\r'):
1292 line = line[:-1]
1289 else:
1293 else:
1290 self.fout.write(b' ')
1294 self.fout.write(b' ')
1291 self.fout.flush()
1295 self.fout.flush()
@@ -1295,10 +1299,6 class ui(object):
1295 if line.endswith(pycompat.oslinesep):
1299 if line.endswith(pycompat.oslinesep):
1296 line = line[:-len(pycompat.oslinesep)]
1300 line = line[:-len(pycompat.oslinesep)]
1297
1301
1298 # When stdin is in binary mode on Windows, it can cause
1299 # raw_input() to emit an extra trailing carriage return
1300 if pycompat.oslinesep == '\r\n' and line and line[-1] == '\r':
1301 line = line[:-1]
1302 return line
1302 return line
1303
1303
1304 def prompt(self, msg, default="y"):
1304 def prompt(self, msg, default="y"):
General Comments 0
You need to be logged in to leave comments. Login now