Mercurial > hg
comparison hgext/win32mbcs.py @ 48934:06de08b36c82
py3: use str instead of pycompat.unicode
pycompat.unicode is an alias to str.
Differential Revision: https://phab.mercurial-scm.org/D12340
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Mon, 21 Feb 2022 11:24:57 -0700 |
parents | 6000f5b25c9b |
children | 48d9af6bd043 |
comparison
equal
deleted
inserted
replaced
48933:78f1de3f4be7 | 48934:06de08b36c82 |
---|---|
92 arg[k] = decode(v) | 92 arg[k] = decode(v) |
93 return arg | 93 return arg |
94 | 94 |
95 | 95 |
96 def encode(arg): | 96 def encode(arg): |
97 if isinstance(arg, pycompat.unicode): | 97 if isinstance(arg, str): |
98 return arg.encode(_encoding) | 98 return arg.encode(_encoding) |
99 elif isinstance(arg, tuple): | 99 elif isinstance(arg, tuple): |
100 return tuple(map(encode, arg)) | 100 return tuple(map(encode, arg)) |
101 elif isinstance(arg, list): | 101 elif isinstance(arg, list): |
102 return map(encode, arg) | 102 return map(encode, arg) |
133 % _encoding | 133 % _encoding |
134 ) | 134 ) |
135 | 135 |
136 | 136 |
137 def wrapper(func, args, kwds): | 137 def wrapper(func, args, kwds): |
138 return basewrapper(func, pycompat.unicode, encode, decode, args, kwds) | 138 return basewrapper(func, str, encode, decode, args, kwds) |
139 | 139 |
140 | 140 |
141 def reversewrapper(func, args, kwds): | 141 def reversewrapper(func, args, kwds): |
142 return basewrapper(func, str, decode, encode, args, kwds) | 142 return basewrapper(func, str, decode, encode, args, kwds) |
143 | 143 |