diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2013-10-08 18:07:46 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-10-08 18:07:46 (GMT) |
commit | 5e596769b025ce724e36aceeae52ce3c4c53c164 (patch) | |
tree | e6b10d9fc43ae290a04d6a1e5b9d31e262780126 /Lib/lib2to3/fixes/fix_unicode.py | |
parent | bcce1256e3ad33374f05e6150b3f349c11ff2643 (diff) | |
download | cpython-5e596769b025ce724e36aceeae52ce3c4c53c164.zip cpython-5e596769b025ce724e36aceeae52ce3c4c53c164.tar.gz cpython-5e596769b025ce724e36aceeae52ce3c4c53c164.tar.bz2 |
Issue #18037: Do not escape '\u' and '\U' in raw strings.
Diffstat (limited to 'Lib/lib2to3/fixes/fix_unicode.py')
-rw-r--r-- | Lib/lib2to3/fixes/fix_unicode.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/lib2to3/fixes/fix_unicode.py b/Lib/lib2to3/fixes/fix_unicode.py index 6555397..c7982c2 100644 --- a/Lib/lib2to3/fixes/fix_unicode.py +++ b/Lib/lib2to3/fixes/fix_unicode.py @@ -28,8 +28,7 @@ class FixUnicode(fixer_base.BaseFix): return new elif node.type == token.STRING: val = node.value - if (not self.unicode_literals and val[0] in 'rR\'"' and - '\\' in val): + if not self.unicode_literals and val[0] in '\'"' and '\\' in val: val = r'\\'.join([ v.replace('\\u', r'\\u').replace('\\U', r'\\U') for v in val.split(r'\\') |