##// END OF EJS Templates
revsetlang: do not pass in non-bytes to parse()...
Yuya Nishihara -
r37793:03d7f885 default
parent child Browse files
Show More
@@ -89,6 +89,9 b' def tokenize(program, lookup=None, symin'
89 89 [('symbol', '@', 0), ('::', None, 1), ('end', None, 3)]
90 90
91 91 '''
92 if not isinstance(program, bytes):
93 raise error.ProgrammingError('revset statement must be bytes, got %r'
94 % program)
92 95 program = pycompat.bytestr(program)
93 96 if syminitletters is None:
94 97 syminitletters = _syminitletters
@@ -581,6 +584,8 b' def _formatargtype(c, arg):'
581 584 elif c == 's':
582 585 return _quote(arg)
583 586 elif c == 'r':
587 if not isinstance(arg, bytes):
588 raise TypeError
584 589 parse(arg) # make sure syntax errors are confined
585 590 return '(%s)' % arg
586 591 elif c == 'n':
General Comments 0
You need to be logged in to leave comments. Login now