Show More
@@ -1278,7 +1278,13 b' class ui(object):' | |||
|
1278 | 1278 | # prompt ' ' must exist; otherwise readline may delete entire line |
|
1279 | 1279 | # - http://bugs.python.org/issue12833 |
|
1280 | 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 | 1289 | # When stdin is in binary mode on Windows, it can cause |
|
1284 | 1290 | # raw_input() to emit an extra trailing carriage return |
@@ -212,14 +212,6 b' def rapply(f, xs):' | |||
|
212 | 212 | return xs |
|
213 | 213 | return _rapply(f, xs) |
|
214 | 214 | |
|
215 | def bytesinput(fin, fout, *args, **kwargs): | |
|
216 | sin, sout = sys.stdin, sys.stdout | |
|
217 | try: | |
|
218 | sys.stdin, sys.stdout = encoding.strio(fin), encoding.strio(fout) | |
|
219 | return encoding.strtolocal(pycompat.rawinput(*args, **kwargs)) | |
|
220 | finally: | |
|
221 | sys.stdin, sys.stdout = sin, sout | |
|
222 | ||
|
223 | 215 | def bitsfrom(container): |
|
224 | 216 | bits = 0 |
|
225 | 217 | for bit in container: |
General Comments 0
You need to be logged in to leave comments.
Login now