From: Stefan Behnel Date: Wed, 8 Jul 2009 18:24:13 +0000 (+0200) Subject: fix byte string escaping of '\' in Py2.x (broken by latest Py3 fixes) X-Git-Tag: 0.12.alpha0~254 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=eacc69212c1ad0fd688b3c69ec08fe40b6258714;p=cython.git fix byte string escaping of '\' in Py2.x (broken by latest Py3 fixes) --- diff --git a/Cython/Compiler/StringEncoding.py b/Cython/Compiler/StringEncoding.py index 346de59d..618c99d7 100644 --- a/Cython/Compiler/StringEncoding.py +++ b/Cython/Compiler/StringEncoding.py @@ -126,7 +126,7 @@ _c_special_replacements = [(orig.encode('ASCII'), def _build_specials_test(): subexps = [] 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) return re.compile('|'.join(subexps).encode('ASCII')).search