mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +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
|
@ -114,7 +114,7 @@ sys_displayhook_unencodable(PyObject *outf, PyObject *o)
|
|||
stdout_encoding = _PyObject_GetAttrId(outf, &PyId_encoding);
|
||||
if (stdout_encoding == NULL)
|
||||
goto error;
|
||||
stdout_encoding_str = _PyUnicode_AsString(stdout_encoding);
|
||||
stdout_encoding_str = PyUnicode_AsUTF8(stdout_encoding);
|
||||
if (stdout_encoding_str == NULL)
|
||||
goto error;
|
||||
|
||||
|
@ -2411,7 +2411,7 @@ sys_format(_Py_Identifier *key, FILE *fp, const char *format, va_list va)
|
|||
if (message != NULL) {
|
||||
if (sys_pyfile_write_unicode(message, file) != 0) {
|
||||
PyErr_Clear();
|
||||
utf8 = _PyUnicode_AsString(message);
|
||||
utf8 = PyUnicode_AsUTF8(message);
|
||||
if (utf8 != NULL)
|
||||
fputs(utf8, fp);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue