Make pickle errror message unicode objects.

This commit is contained in:
Walter Dörwald 2007-06-20 12:37:01 +00:00
parent bc1f886170
commit 38e6a69a20
1 changed files with 2 additions and 2 deletions

View File

@ -393,13 +393,13 @@ cPickle_ErrFormat(PyObject *ErrType, char *stringformat, char *format, ...)
if (format) args = Py_VaBuildValue(format, va); if (format) args = Py_VaBuildValue(format, va);
va_end(va); va_end(va);
if (format && ! args) return NULL; if (format && ! args) return NULL;
if (stringformat && !(retval=PyString_FromString(stringformat))) if (stringformat && !(retval=PyUnicode_FromString(stringformat)))
return NULL; return NULL;
if (retval) { if (retval) {
if (args) { if (args) {
PyObject *v; PyObject *v;
v=PyString_Format(retval, args); v=PyUnicode_Format(retval, args);
Py_DECREF(retval); Py_DECREF(retval);
Py_DECREF(args); Py_DECREF(args);
if (! v) return NULL; if (! v) return NULL;