comparison mercurial/commands.py @ 36522:6e90c59b6da1

py3: use pycompat.bytestr() to convert error instances to bytes Differential Revision: https://phab.mercurial-scm.org/D2516
author Pulkit Goyal <7895pulkit@gmail.com>
date Thu, 01 Mar 2018 23:54:52 +0530
parents ab5f18a9dcac
children aa3294027936
comparison
equal deleted inserted replaced
36521:149c5af35de5 36522:6e90c59b6da1
2368 if opts.get('ignore_case'): 2368 if opts.get('ignore_case'):
2369 reflags |= re.I 2369 reflags |= re.I
2370 try: 2370 try:
2371 regexp = util.re.compile(pattern, reflags) 2371 regexp = util.re.compile(pattern, reflags)
2372 except re.error as inst: 2372 except re.error as inst:
2373 ui.warn(_("grep: invalid match pattern: %s\n") % inst) 2373 ui.warn(_("grep: invalid match pattern: %s\n") % pycompat.bytestr(inst))
2374 return 1 2374 return 1
2375 sep, eol = ':', '\n' 2375 sep, eol = ':', '\n'
2376 if opts.get('print0'): 2376 if opts.get('print0'):
2377 sep = eol = '\0' 2377 sep = eol = '\0'
2378 2378