equal
deleted
inserted
replaced
1276 pass |
1276 pass |
1277 |
1277 |
1278 # prompt ' ' must exist; otherwise readline may delete entire line |
1278 # prompt ' ' must exist; otherwise readline may delete entire line |
1279 # - http://bugs.python.org/issue12833 |
1279 # - http://bugs.python.org/issue12833 |
1280 with self.timeblockedsection('stdio'): |
1280 with self.timeblockedsection('stdio'): |
1281 line = util.bytesinput(self.fin, self.fout, r' ') |
1281 sin, sout = sys.stdin, sys.stdout |
|
1282 try: |
|
1283 sys.stdin = encoding.strio(self.fin) |
|
1284 sys.stdout = encoding.strio(self.fout) |
|
1285 line = encoding.strtolocal(pycompat.rawinput(r' ')) |
|
1286 finally: |
|
1287 sys.stdin, sys.stdout = sin, sout |
1282 |
1288 |
1283 # When stdin is in binary mode on Windows, it can cause |
1289 # When stdin is in binary mode on Windows, it can cause |
1284 # raw_input() to emit an extra trailing carriage return |
1290 # raw_input() to emit an extra trailing carriage return |
1285 if pycompat.oslinesep == '\r\n' and line and line[-1] == '\r': |
1291 if pycompat.oslinesep == '\r\n' and line and line[-1] == '\r': |
1286 line = line[:-1] |
1292 line = line[:-1] |