Patchwork [01,of,10,py3] pycompat: add maplist alias for old map behavior

login
register
mail settings
Submitter Augie Fackler
Date March 19, 2017, 6:26 p.m.
Message ID <b68f9464efb7ef50f6f0.1489947974@imladris.local>
Download mbox | patch
Permalink /patch/19450/
State Accepted
Headers show

Comments

Augie Fackler - March 19, 2017, 6:26 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1489947158 14400
#      Sun Mar 19 14:12:38 2017 -0400
# Node ID b68f9464efb7ef50f6f0a8f811da91b414546e20
# Parent  a369482e9649478cbab5b08a204406a10ee66588
pycompat: add maplist alias for old map behavior
Yuya Nishihara - March 20, 2017, 4:40 a.m.
On Sun, 19 Mar 2017 14:26:14 -0400, Augie Fackler wrote:
> # HG changeset patch
> # User Augie Fackler <augie@google.com>
> # Date 1489947158 14400
> #      Sun Mar 19 14:12:38 2017 -0400
> # Node ID b68f9464efb7ef50f6f0a8f811da91b414546e20
> # Parent  a369482e9649478cbab5b08a204406a10ee66588
> pycompat: add maplist alias for old map behavior

Queued these, thanks.

Patch

diff --git a/mercurial/pycompat.py b/mercurial/pycompat.py
--- a/mercurial/pycompat.py
+++ b/mercurial/pycompat.py
@@ -57,6 +57,7 @@  if ispy3:
     if sysexecutable:
         sysexecutable = os.fsencode(sysexecutable)
     stringio = io.BytesIO
+    maplist = lambda *args: list(map(*args))
 
     # TODO: .buffer might not exist if std streams were replaced; we'll need
     # a silly wrapper to make a bytes stream backed by a unicode one.
@@ -251,6 +252,7 @@  else:
     sysexecutable = sys.executable
     shlexsplit = shlex.split
     stringio = cStringIO.StringIO
+    maplist = map
 
 empty = _queue.Empty
 queue = _queue.Queue