From eacc69212c1ad0fd688b3c69ec08fe40b6258714 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Wed, 8 Jul 2009 20:24:13 +0200 Subject: [PATCH] fix byte string escaping of '\' in Py2.x (broken by latest Py3 fixes) --- Cython/Compiler/StringEncoding.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.26.2