Mercurial > hg
comparison mercurial/pycompat.py @ 36934:dbae581010ea
pycompat: name maplist() and ziplist() for better traceback message
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Tue, 13 Mar 2018 21:22:14 +0900 |
parents | 6585ac350fd9 |
children | 644a02f6b34f |
comparison
equal
deleted
inserted
replaced
36933:61600b024a70 | 36934:dbae581010ea |
---|---|
63 sysplatform = sys.platform.encode('ascii') | 63 sysplatform = sys.platform.encode('ascii') |
64 sysexecutable = sys.executable | 64 sysexecutable = sys.executable |
65 if sysexecutable: | 65 if sysexecutable: |
66 sysexecutable = os.fsencode(sysexecutable) | 66 sysexecutable = os.fsencode(sysexecutable) |
67 stringio = io.BytesIO | 67 stringio = io.BytesIO |
68 maplist = lambda *args: list(map(*args)) | 68 |
69 ziplist = lambda *args: list(zip(*args)) | 69 def maplist(*args): |
70 return list(map(*args)) | |
71 | |
72 def ziplist(*args): | |
73 return list(zip(*args)) | |
74 | |
70 rawinput = input | 75 rawinput = input |
71 getargspec = inspect.getfullargspec | 76 getargspec = inspect.getfullargspec |
72 | 77 |
73 # TODO: .buffer might not exist if std streams were replaced; we'll need | 78 # TODO: .buffer might not exist if std streams were replaced; we'll need |
74 # a silly wrapper to make a bytes stream backed by a unicode one. | 79 # a silly wrapper to make a bytes stream backed by a unicode one. |