[pypy-commit] pypy py3k: don't represent these characters as u'foo'

MichaelBlume noreply at buildbot.pypy.org
Mon Mar 12 20:01:45 CET 2012


Author: Mike Blume <mike at loggly.com>
Branch: py3k
Changeset: r53330:1ef6650897ed
Date: 2012-03-12 11:35 -0700
http://bitbucket.org/pypy/pypy/changeset/1ef6650897ed/

Log:	don't represent these characters as u'foo'

	python3 doesn't use u''

diff --git a/pypy/module/exceptions/interp_exceptions.py b/pypy/module/exceptions/interp_exceptions.py
--- a/pypy/module/exceptions/interp_exceptions.py
+++ b/pypy/module/exceptions/interp_exceptions.py
@@ -348,10 +348,10 @@
             if self.end == self.start + 1:
                 badchar = ord(self.object[self.start])
                 if badchar <= 0xff:
-                    return "can't translate character u'\\x%02x' in position %d: %s" % (badchar, self.start, self.reason)
+                    return "can't translate character '\\x%02x' in position %d: %s" % (badchar, self.start, self.reason)
                 if badchar <= 0xffff:
-                    return "can't translate character u'\\u%04x' in position %d: %s"%(badchar, self.start, self.reason)
-                return "can't translate character u'\\U%08x' in position %d: %s"%(badchar, self.start, self.reason)
+                    return "can't translate character '\\u%04x' in position %d: %s"%(badchar, self.start, self.reason)
+                return "can't translate character '\\U%08x' in position %d: %s"%(badchar, self.start, self.reason)
             return "can't translate characters in position %d-%d: %s" % (self.start, self.end - 1, self.reason)
         """)
 
@@ -785,12 +785,12 @@
             if self.end == self.start + 1:
                 badchar = ord(self.object[self.start])
                 if badchar <= 0xff:
-                    return "'%s' codec can't encode character u'\\x%02x' in position %d: %s"%(
+                    return "'%s' codec can't encode character '\\x%02x' in position %d: %s"%(
                         self.encoding, badchar, self.start, self.reason)
                 if badchar <= 0xffff:
-                    return "'%s' codec can't encode character u'\\u%04x' in position %d: %s"%(
+                    return "'%s' codec can't encode character '\\u%04x' in position %d: %s"%(
                         self.encoding, badchar, self.start, self.reason)
-                return "'%s' codec can't encode character u'\\U%08x' in position %d: %s"%(
+                return "'%s' codec can't encode character '\\U%08x' in position %d: %s"%(
                     self.encoding, badchar, self.start, self.reason)
             return "'%s' codec can't encode characters in position %d-%d: %s" % (
                 self.encoding, self.start, self.end - 1, self.reason)


More information about the pypy-commit mailing list