changeset 31392:7556fe09cc48

py3: convert set of revset initial symbols back to bytes Otherwise tokenize() would fail due to comparison between unicode and bytes.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 12 Mar 2017 17:10:14 -0700
parents c9fd842dc886
children fac5cd3b8673
files mercurial/revsetlang.py
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revsetlang.py	Sun Mar 12 17:04:45 2017 -0700
+++ b/mercurial/revsetlang.py	Sun Mar 12 17:10:14 2017 -0700
@@ -46,12 +46,13 @@
 keywords = set(['and', 'or', 'not'])
 
 # default set of valid characters for the initial letter of symbols
-_syminitletters = set(
-    string.ascii_letters +
-    string.digits + pycompat.sysstr('._@')) | set(map(chr, xrange(128, 256)))
+_syminitletters = set(pycompat.iterbytestr(
+    string.ascii_letters.encode('ascii') +
+    string.digits.encode('ascii') +
+    '._@')) | set(map(pycompat.bytechr, xrange(128, 256)))
 
 # default set of valid characters for non-initial letters of symbols
-_symletters = _syminitletters | set(pycompat.sysstr('-/'))
+_symletters = _syminitletters | set(pycompat.iterbytestr('-/'))
 
 def tokenize(program, lookup=None, syminitletters=None, symletters=None):
     '''