ui: construct _keepalnum list in a python3-friendly way
It'll be more expensive, but it preserves the behavior.
--- a/mercurial/ui.py Mon Feb 13 17:03:14 2017 -0800
+++ b/mercurial/ui.py Thu Feb 16 11:34:50 2017 -0500
@@ -39,7 +39,12 @@
urlreq = util.urlreq
# for use with str.translate(None, _keepalnum), to keep just alphanumerics
-_keepalnum = ''.join(c for c in map(chr, range(256)) if not c.isalnum())
+if pycompat.ispy3:
+ _bytes = [bytes([c]) for c in range(256)]
+ _notalnum = [s for s in _bytes if not s.isalnum()]
+else:
+ _notalnum = [c for c in map(chr, range(256)) if not c.isalnum()]
+_keepalnum = ''.join(_notalnum)
samplehgrcs = {
'user':