comparison mercurial/pycompat.py @ 31501:a1e40ceee640

pycompat: add maplist alias for old map behavior
author Augie Fackler <augie@google.com>
date Sun, 19 Mar 2017 14:12:38 -0400
parents b70407bd84d5
children c6df6a23dfe5
comparison
equal deleted inserted replaced
31500:bc315e669a32 31501:a1e40ceee640
55 sysplatform = sys.platform.encode('ascii') 55 sysplatform = sys.platform.encode('ascii')
56 sysexecutable = sys.executable 56 sysexecutable = sys.executable
57 if sysexecutable: 57 if sysexecutable:
58 sysexecutable = os.fsencode(sysexecutable) 58 sysexecutable = os.fsencode(sysexecutable)
59 stringio = io.BytesIO 59 stringio = io.BytesIO
60 maplist = lambda *args: list(map(*args))
60 61
61 # TODO: .buffer might not exist if std streams were replaced; we'll need 62 # TODO: .buffer might not exist if std streams were replaced; we'll need
62 # a silly wrapper to make a bytes stream backed by a unicode one. 63 # a silly wrapper to make a bytes stream backed by a unicode one.
63 stdin = sys.stdin.buffer 64 stdin = sys.stdin.buffer
64 stdout = sys.stdout.buffer 65 stdout = sys.stdout.buffer
249 sysplatform = sys.platform 250 sysplatform = sys.platform
250 getcwd = os.getcwd 251 getcwd = os.getcwd
251 sysexecutable = sys.executable 252 sysexecutable = sys.executable
252 shlexsplit = shlex.split 253 shlexsplit = shlex.split
253 stringio = cStringIO.StringIO 254 stringio = cStringIO.StringIO
255 maplist = map
254 256
255 empty = _queue.Empty 257 empty = _queue.Empty
256 queue = _queue.Queue 258 queue = _queue.Queue
257 259
258 class _pycompatstub(object): 260 class _pycompatstub(object):