PyCodec_IgnoreErrors() avoids the deprecated "u#" format

This commit is contained in:
Victor Stinner 2011-12-01 02:52:11 +01:00
parent db88ae5d66
commit ee450093a9
1 changed files with 1 additions and 2 deletions

View File

@ -510,8 +510,7 @@ PyObject *PyCodec_IgnoreErrors(PyObject *exc)
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);
}