[Python-checkins] cpython: PyCodec_IgnoreErrors() avoids the deprecated "u#" format

victor.stinner python-checkins at python.org
Thu Dec 1 02:52:12 CET 2011


http://hg.python.org/cpython/rev/6407294eb3c6
changeset: 73800:6407294eb3c6
user: Victor Stinner <victor.stinner at haypocalc.com>
date: Thu Dec 01 02:52:11 2011 +0100
summary:
 PyCodec_IgnoreErrors() avoids the deprecated "u#" format
files:
 Python/codecs.c | 3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/Python/codecs.c b/Python/codecs.c
--- a/Python/codecs.c
+++ b/Python/codecs.c
@@ -510,8 +510,7 @@
 wrong_exception_type(exc);
 return NULL;
 }
- /* ouch: passing NULL, 0, pos gives None instead of u'' */
- return Py_BuildValue("(u#n)", &end, 0, end);
+ return Py_BuildValue("(Nn)", PyUnicode_New(0, 0), end);
 }
 
 
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /