summaryrefslogtreecommitdiffstats
path: root/Lib/lib2to3/fixes
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-10-08 18:08:48 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-10-08 18:08:48 (GMT)
commit1322f9e2d1a546328e53aa7d037bc37c3b47fc2e (patch)
tree8ff35a9c20d88090db0599bc1c1fd0a4b3a6d6c5 /Lib/lib2to3/fixes
parent245c765d0a73e385ff00a982d2c60d0a96c94c74 (diff)
parent5e596769b025ce724e36aceeae52ce3c4c53c164 (diff)
downloadcpython-1322f9e2d1a546328e53aa7d037bc37c3b47fc2e.zip
cpython-1322f9e2d1a546328e53aa7d037bc37c3b47fc2e.tar.gz
cpython-1322f9e2d1a546328e53aa7d037bc37c3b47fc2e.tar.bz2
Issue #18037: Do not escape '\u' and '\U' in raw strings.
Diffstat (limited to 'Lib/lib2to3/fixes')
-rw-r--r--Lib/lib2to3/fixes/fix_unicode.py3
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'\\')