mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Replaced outdated macros _PyUnicode_AsString and _PyUnicode_AsStringAndSize
with PyUnicode_AsUTF8 and PyUnicode_AsUTF8AndSize.
This commit is contained in:
parent
e20973926a
commit
06515833fe
31 changed files with 62 additions and 62 deletions
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue