[Python-checkins] cpython (merge default -> default): merge heads

georg.brandl python-checkins at python.org
Tue Oct 8 20:26:57 CEST 2013


http://hg.python.org/cpython/rev/9619c22b2c97
changeset:   86149:9619c22b2c97
parent:      86148:1800107873c0
parent:      86147:a49d313a28ae
user:        Georg Brandl <georg at python.org>
date:        Tue Oct 08 20:27:35 2013 +0200
summary:
  merge heads

files:
  Lib/lib2to3/fixes/fix_unicode.py |  3 +--
  Lib/lib2to3/tests/test_fixers.py |  2 +-
  2 files changed, 2 insertions(+), 3 deletions(-)


diff --git a/Lib/lib2to3/fixes/fix_unicode.py b/Lib/lib2to3/fixes/fix_unicode.py
--- a/Lib/lib2to3/fixes/fix_unicode.py
+++ b/Lib/lib2to3/fixes/fix_unicode.py
@@ -28,8 +28,7 @@
             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'\\')
diff --git a/Lib/lib2to3/tests/test_fixers.py b/Lib/lib2to3/tests/test_fixers.py
--- a/Lib/lib2to3/tests/test_fixers.py
+++ b/Lib/lib2to3/tests/test_fixers.py
@@ -2889,7 +2889,7 @@
         self.check(b, a)
 
         b = r"""r'\\\u20ac\U0001d121\\u20ac'"""
-        a = r"""r'\\\\u20ac\\U0001d121\\u20ac'"""
+        a = r"""r'\\\u20ac\U0001d121\\u20ac'"""
         self.check(b, a)
 
     def test_bytes_literal_escape_u(self):

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list