summaryrefslogtreecommitdiffstats
path: root/Objects/exceptions.c
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2007-06-20 09:25:34 (GMT)
committerWalter Dörwald <walter@livinglogic.de>2007-06-20 09:25:34 (GMT)
commit32a4c7141911c58f01afe7b89482dbd4ce4f817f (patch)
tree32b3b7a299117ed3c766716bdeaf7d2ab6e46f5f /Objects/exceptions.c
parent31f72d72b1e0c772becbfa9bbd3ab1827c704726 (diff)
downloadcpython-32a4c7141911c58f01afe7b89482dbd4ce4f817f.zip
cpython-32a4c7141911c58f01afe7b89482dbd4ce4f817f.tar.gz
cpython-32a4c7141911c58f01afe7b89482dbd4ce4f817f.tar.bz2
Patch by Ron Adam: Don't use u prefix in unicode error messages
and remove u prefix from some comments in test_codecs.py.
Diffstat (limited to 'Objects/exceptions.c')
-rw-r--r--Objects/exceptions.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/Objects/exceptions.c b/Objects/exceptions.c
index 8d1ee2a..1df0ea0 100644
--- a/Objects/exceptions.c
+++ b/Objects/exceptions.c
@@ -1289,11 +1289,11 @@ UnicodeEncodeError_str(PyObject *self)
int badchar = (int)PyUnicode_AS_UNICODE(uself->object)[uself->start];
const char *fmt;
if (badchar <= 0xff)
- fmt = "'%U' codec can't encode character u'\\x%02x' in position %zd: %U";
+ fmt = "'%U' codec can't encode character '\\x%02x' in position %zd: %U";
else if (badchar <= 0xffff)
- fmt = "'%U' codec can't encode character u'\\u%04x' in position %zd: %U";
+ fmt = "'%U' codec can't encode character '\\u%04x' in position %zd: %U";
else
- fmt = "'%U' codec can't encode character u'\\U%08x' in position %zd: %U";
+ fmt = "'%U' codec can't encode character '\\U%08x' in position %zd: %U";
return PyUnicode_FromFormat(
fmt,
((PyUnicodeErrorObject *)self)->encoding,
@@ -1440,11 +1440,11 @@ UnicodeTranslateError_str(PyObject *self)
int badchar = (int)PyUnicode_AS_UNICODE(uself->object)[uself->start];
const char *fmt;
if (badchar <= 0xff)
- fmt = "can't translate character u'\\x%02x' in position %zd: %U";
+ fmt = "can't translate character '\\x%02x' in position %zd: %U";
else if (badchar <= 0xffff)
- fmt = "can't translate character u'\\u%04x' in position %zd: %U";
+ fmt = "can't translate character '\\u%04x' in position %zd: %U";
else
- fmt = "can't translate character u'\\U%08x' in position %zd: %U";
+ fmt = "can't translate character '\\U%08x' in position %zd: %U";
return PyUnicode_FromFormat(
fmt,
badchar,