Patchwork D1100: wireproto: use listcomp instead of map()

login
register
mail settings
Submitter phabricator
Date Oct. 16, 2017, 1:30 a.m.
Message ID <differential-rev-PHID-DREV-wlrbtlioudc7ioopfkxi-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/24959/
State Superseded
Headers show

Comments

phabricator - Oct. 16, 2017, 1:30 a.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  The latter returns a generator object on Python 3, which breaks
  various parts of hg that expected a list.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D1100

AFFECTED FILES
  mercurial/wireproto.py

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-devel
phabricator - Oct. 16, 2017, 9:15 a.m.
ryanmce accepted this revision.
ryanmce added a comment.
This revision is now accepted and ready to land.


  queued

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D1100

To: durin42, #hg-reviewers, ryanmce
Cc: ryanmce, mercurial-devel

Patch

diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py
--- a/mercurial/wireproto.py
+++ b/mercurial/wireproto.py
@@ -153,7 +153,7 @@ 
 
 def decodelist(l, sep=' '):
     if l:
-        return map(bin, l.split(sep))
+        return [bin(v) for v in  l.split(sep)]
     return []
 
 def encodelist(l, sep=' '):