##// END OF EJS Templates
py3: select input or raw_input by pycompat...
Yuya Nishihara -
r33853:cfcfbe6c default
parent child Browse files
Show More
@@ -63,6 +63,7 b' if ispy3:'
63 63 sysexecutable = os.fsencode(sysexecutable)
64 64 stringio = io.BytesIO
65 65 maplist = lambda *args: list(map(*args))
66 rawinput = input
66 67
67 68 # TODO: .buffer might not exist if std streams were replaced; we'll need
68 69 # a silly wrapper to make a bytes stream backed by a unicode one.
@@ -312,6 +313,7 b' else:'
312 313 shlexsplit = shlex.split
313 314 stringio = cStringIO.StringIO
314 315 maplist = map
316 rawinput = raw_input
315 317
316 318 class _pycompatstub(object):
317 319 def __init__(self):
@@ -176,10 +176,7 b' def bytesinput(fin, fout, *args, **kwarg'
176 176 sin, sout = sys.stdin, sys.stdout
177 177 try:
178 178 sys.stdin, sys.stdout = encoding.strio(fin), encoding.strio(fout)
179 if pycompat.ispy3:
180 return encoding.strtolocal(input(*args, **kwargs))
181 else:
182 return raw_input(*args, **kwargs)
179 return encoding.strtolocal(pycompat.rawinput(*args, **kwargs))
183 180 finally:
184 181 sys.stdin, sys.stdout = sin, sout
185 182
General Comments 0
You need to be logged in to leave comments. Login now