diff --git a/mercurial/config.py b/mercurial/config.py --- a/mercurial/config.py +++ b/mercurial/config.py @@ -90,13 +90,13 @@ class config(object): self._source.pop((section, item), None) def parse(self, src, data, sections=None, remap=None, include=None): - sectionre = util.re.compile(r'\[([^\[]+)\]') - itemre = util.re.compile(r'([^=\s][^=]*?)\s*=\s*(.*\S|)') - contre = util.re.compile(r'\s+(\S|\S.*\S)\s*$') - emptyre = util.re.compile(r'(;|#|\s*$)') - commentre = util.re.compile(r'(;|#)') - unsetre = util.re.compile(r'%unset\s+(\S+)') - includere = util.re.compile(r'%include\s+(\S|\S.*\S)\s*$') + sectionre = util.re.compile(br'\[([^\[]+)\]') + itemre = util.re.compile(br'([^=\s][^=]*?)\s*=\s*(.*\S|)') + contre = util.re.compile(br'\s+(\S|\S.*\S)\s*$') + emptyre = util.re.compile(br'(;|#|\s*$)') + commentre = util.re.compile(br'(;|#)') + unsetre = util.re.compile(br'%unset\s+(\S+)') + includere = util.re.compile(br'%include\s+(\S|\S.*\S)\s*$') section = "" item = None line = 0 diff --git a/tests/test-check-py3-commands.t b/tests/test-check-py3-commands.t --- a/tests/test-check-py3-commands.t +++ b/tests/test-check-py3-commands.t @@ -9,6 +9,6 @@ The full traceback is hidden to have a s > $PYTHON3 `which hg` $cmd 2>&1 2>&1 | tail -1 > done version - TypeError: cannot use a string pattern on a bytes-like object + NameError: name 'basestring' is not defined debuginstall - TypeError: cannot use a string pattern on a bytes-like object + NameError: name 'basestring' is not defined