diff Python/codecs.c @ 73800:6407294eb3c6

PyCodec_IgnoreErrors() avoids the deprecated "u#" format
author Victor Stinner <victor.stinner@haypocalc.com>
date Thu, 01 Dec 2011 02:52:11 +0100
parents e3b6458056c7
children f55529aa023d
line wrap: on
line diff
--- a/Python/codecs.c	Thu Dec 01 02:15:00 2011 +0100
+++ b/Python/codecs.c	Thu Dec 01 02:52:11 2011 +0100
@@ -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);
 }