Commit eacc6921 authored by Stefan Behnel's avatar Stefan Behnel

fix byte string escaping of '\' in Py2.x (broken by latest Py3 fixes)

parent 0d632d87
...@@ -126,7 +126,7 @@ _c_special_replacements = [(orig.encode('ASCII'), ...@@ -126,7 +126,7 @@ _c_special_replacements = [(orig.encode('ASCII'),
def _build_specials_test(): def _build_specials_test():
subexps = [] subexps = []
for special in _c_special: for special in _c_special:
regexp = ''.join(['[%s]' % c for c in special]) regexp = ''.join(['[%s]' % c.replace('\\', '\\\\') for c in special])
subexps.append(regexp) subexps.append(regexp)
return re.compile('|'.join(subexps).encode('ASCII')).search return re.compile('|'.join(subexps).encode('ASCII')).search
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment