##// END OF EJS Templates
config: mark parser regexes as bytes explicitly...
Augie Fackler -
r30349:95400242 default
parent child Browse files
Show More
@@ -90,13 +90,13 b' class config(object):'
90 self._source.pop((section, item), None)
90 self._source.pop((section, item), None)
91
91
92 def parse(self, src, data, sections=None, remap=None, include=None):
92 def parse(self, src, data, sections=None, remap=None, include=None):
93 sectionre = util.re.compile(r'\[([^\[]+)\]')
93 sectionre = util.re.compile(br'\[([^\[]+)\]')
94 itemre = util.re.compile(r'([^=\s][^=]*?)\s*=\s*(.*\S|)')
94 itemre = util.re.compile(br'([^=\s][^=]*?)\s*=\s*(.*\S|)')
95 contre = util.re.compile(r'\s+(\S|\S.*\S)\s*$')
95 contre = util.re.compile(br'\s+(\S|\S.*\S)\s*$')
96 emptyre = util.re.compile(r'(;|#|\s*$)')
96 emptyre = util.re.compile(br'(;|#|\s*$)')
97 commentre = util.re.compile(r'(;|#)')
97 commentre = util.re.compile(br'(;|#)')
98 unsetre = util.re.compile(r'%unset\s+(\S+)')
98 unsetre = util.re.compile(br'%unset\s+(\S+)')
99 includere = util.re.compile(r'%include\s+(\S|\S.*\S)\s*$')
99 includere = util.re.compile(br'%include\s+(\S|\S.*\S)\s*$')
100 section = ""
100 section = ""
101 item = None
101 item = None
102 line = 0
102 line = 0
@@ -9,6 +9,6 b' The full traceback is hidden to have a s'
9 > $PYTHON3 `which hg` $cmd 2>&1 2>&1 | tail -1
9 > $PYTHON3 `which hg` $cmd 2>&1 2>&1 | tail -1
10 > done
10 > done
11 version
11 version
12 TypeError: cannot use a string pattern on a bytes-like object
12 NameError: name 'basestring' is not defined
13 debuginstall
13 debuginstall
14 TypeError: cannot use a string pattern on a bytes-like object
14 NameError: name 'basestring' is not defined
General Comments 0
You need to be logged in to leave comments. Login now