diff options
author | Benjamin Peterson <benjamin@python.org> | 2013-12-20 21:53:58 -0600 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2013-12-20 21:53:58 -0600 |
commit | cff44f7829291fb4605d47ce4a9c33c5eee5ead6 (patch) | |
tree | f77095587eca5f1e912e39196801f163a5fb2527 | |
parent | 617ae7ce0a7f04790b89aec4014a0d75fc14889b (diff) | |
download | six-cff44f7829291fb4605d47ce4a9c33c5eee5ead6.tar.gz |
use replace instead regular expression
-rw-r--r-- | six.py | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -21,7 +21,6 @@ # SOFTWARE. import operator -import re import sys import types @@ -470,9 +469,8 @@ else: def b(s): return s # Workaround for standalone backslash - _U = re.compile(r'\\(?![uU])') def u(s): - return unicode(_U.sub('\\u005C', s), "unicode_escape") + return unicode(s.replace(r'\\', r'\\\\'), "unicode_escape") unichr = unichr int2byte = chr def byte2int(bs): |