aboutsummaryrefslogtreecommitdiff
path: root/py
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2016-12-20 15:45:21 +0100
committerArmin Rigo <arigo@tunes.org>2016-12-20 15:45:21 +0100
commit0510130ab931a4a2bd27b03644723fe1506d2e48 (patch)
tree75390b6fc45785e6c04dc8eacf40a486ddf62426 /py
parentBackout 5d96f9ed88fe, 55980e9a374e, 2aa05052bb18 (diff)
downloadpypy-0510130ab931a4a2bd27b03644723fe1506d2e48.tar.gz
pypy-0510130ab931a4a2bd27b03644723fe1506d2e48.tar.bz2
pypy-0510130ab931a4a2bd27b03644723fe1506d2e48.zip
Maybe temporary: change py.test, which displays unicode strings 'xx'
instead of u'xx'. It's very annoying when the difference is essential, like in the py3.5-newtext branch.
Diffstat (limited to 'py')
-rw-r--r--py/_io/saferepr.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/py/_io/saferepr.py b/py/_io/saferepr.py
index 8518290efd..c988b23f8d 100644
--- a/py/_io/saferepr.py
+++ b/py/_io/saferepr.py
@@ -16,11 +16,11 @@ class SafeRepr(reprlib.Repr):
# Strictly speaking wrong on narrow builds
def repr(u):
if "'" not in u:
- return py.builtin._totext("'%s'") % u
+ return py.builtin._totext("u'%s'") % u
elif '"' not in u:
- return py.builtin._totext('"%s"') % u
+ return py.builtin._totext('u"%s"') % u
else:
- return py.builtin._totext("'%s'") % u.replace("'", r"\'")
+ return py.builtin._totext("u'%s'") % u.replace("'", r"\'")
s = repr(x[:self.maxstring])
if len(s) > self.maxstring:
i = max(0, (self.maxstring-3)//2)