Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r89207:004274f1f5a3
Date: 2016-12-20 17:12 +0100
http://bitbucket.org/pypy/pypy/changeset/004274f1f5a3/

Log:    Reduce the diff with the original

diff --git a/py/_io/saferepr.py b/py/_io/saferepr.py
--- a/py/_io/saferepr.py
+++ b/py/_io/saferepr.py
@@ -16,11 +16,16 @@
         # Strictly speaking wrong on narrow builds
         def repr(u):
             if "'" not in u:
-                return py.builtin._totext("u'%s'") % u
+                return py.builtin._totext("'%s'") % u
             elif '"' not in u:
-                return py.builtin._totext('u"%s"') % u
+                return py.builtin._totext('"%s"') % u
             else:
-                return py.builtin._totext("u'%s'") % u.replace("'", r"\'")
+                return py.builtin._totext("'%s'") % u.replace("'", r"\'")
+
+        repr = builtin_repr
+        # ^^^ it's very annoying to display 'xx' instead of u'xx' when
+        # the difference can be essential, particularly in PyPy
+
         s = repr(x[:self.maxstring])
         if len(s) > self.maxstring:
             i = max(0, (self.maxstring-3)//2)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to