diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-11-20 07:13:07 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-11-20 07:13:07 (GMT) |
commit | 06515833fef7b8b5c7968edf72367d94ff7eb1e0 (patch) | |
tree | 58a7c06bba8141883a5e5c8621d2b0683ae9fe2e /Modules/_io | |
parent | e20973926a2ec19c4b87e460dc6f0edb478ce352 (diff) | |
download | cpython-06515833fef7b8b5c7968edf72367d94ff7eb1e0.zip cpython-06515833fef7b8b5c7968edf72367d94ff7eb1e0.tar.gz cpython-06515833fef7b8b5c7968edf72367d94ff7eb1e0.tar.bz2 |
Replaced outdated macros _PyUnicode_AsString and _PyUnicode_AsStringAndSize
with PyUnicode_AsUTF8 and PyUnicode_AsUTF8AndSize.
Diffstat (limited to 'Modules/_io')
-rw-r--r-- | Modules/_io/stringio.c | 2 | ||||
-rw-r--r-- | Modules/_io/textio.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/Modules/_io/stringio.c b/Modules/_io/stringio.c index ecf6dc1..8542efd 100644 --- a/Modules/_io/stringio.c +++ b/Modules/_io/stringio.c @@ -708,7 +708,7 @@ _io_StringIO___init___impl(stringio *self, PyObject *value, Py_TYPE(newline_obj)->tp_name); return -1; } - newline = _PyUnicode_AsString(newline_obj); + newline = PyUnicode_AsUTF8(newline_obj); if (newline == NULL) return -1; } diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c index 2f55eb0..1c7200b 100644 --- a/Modules/_io/textio.c +++ b/Modules/_io/textio.c @@ -921,7 +921,7 @@ _io_TextIOWrapper___init___impl(textio *self, PyObject *buffer, Py_CLEAR(self->encoding); } if (self->encoding != NULL) { - encoding = _PyUnicode_AsString(self->encoding); + encoding = PyUnicode_AsUTF8(self->encoding); if (encoding == NULL) goto error; } @@ -964,7 +964,7 @@ _io_TextIOWrapper___init___impl(textio *self, PyObject *buffer, } self->writetranslate = (newline == NULL || newline[0] != '\0'); if (!self->readuniversal && self->readnl) { - self->writenl = _PyUnicode_AsString(self->readnl); + self->writenl = PyUnicode_AsUTF8(self->readnl); if (self->writenl == NULL) goto error; if (!strcmp(self->writenl, "\n")) |