Replaced outdated macros _PyUnicode_AsString and _PyUnicode_AsStringAndSize

with PyUnicode_AsUTF8 and PyUnicode_AsUTF8AndSize.
This commit is contained in:
Serhiy Storchaka 2016-11-20 09:13:07 +02:00
parent e20973926a
commit 06515833fe
31 changed files with 62 additions and 62 deletions

View file

@ -267,7 +267,7 @@ getcodec(PyObject *self, PyObject *encoding)
"encoding name must be a string.");
return NULL;
}
enc = _PyUnicode_AsString(encoding);
enc = PyUnicode_AsUTF8(encoding);
if (enc == NULL)
return NULL;

View file

@ -85,7 +85,7 @@ call_error_callback(PyObject *errors, PyObject *exc)
const char *str;
assert(PyUnicode_Check(errors));
str = _PyUnicode_AsString(errors);
str = PyUnicode_AsUTF8(errors);
if (str == NULL)
return NULL;
cb = PyCodec_LookupError(str);
@ -138,7 +138,7 @@ codecctx_errors_set(MultibyteStatefulCodecContext *self, PyObject *value,
return -1;
}
str = _PyUnicode_AsString(value);
str = PyUnicode_AsUTF8(value);
if (str == NULL)
return -1;