Mercurial > hg
comparison mercurial/wireproto.py @ 34729:6f532c1a4af0
wireproto: use listcomp instead of map()
The latter returns a generator object on Python 3, which breaks
various parts of hg that expected a list.
Differential Revision: https://phab.mercurial-scm.org/D1100
author | Augie Fackler <augie@google.com> |
---|---|
date | Sun, 15 Oct 2017 00:39:29 -0400 |
parents | daf12f69699f |
children | 6be264009841 |
comparison
equal
deleted
inserted
replaced
34728:09397d0dd3b7 | 34729:6f532c1a4af0 |
---|---|
151 | 151 |
152 # list of nodes encoding / decoding | 152 # list of nodes encoding / decoding |
153 | 153 |
154 def decodelist(l, sep=' '): | 154 def decodelist(l, sep=' '): |
155 if l: | 155 if l: |
156 return map(bin, l.split(sep)) | 156 return [bin(v) for v in l.split(sep)] |
157 return [] | 157 return [] |
158 | 158 |
159 def encodelist(l, sep=' '): | 159 def encodelist(l, sep=' '): |
160 try: | 160 try: |
161 return sep.join(map(hex, l)) | 161 return sep.join(map(hex, l)) |