Replaced outdated macros _PyUnicode_AsString and _PyUnicode_AsStringAndSize
with PyUnicode_AsUTF8 and PyUnicode_AsUTF8AndSize.
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index cee013f..a49cb9d 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -1903,8 +1903,8 @@
             /* stdin is a text stream, so it must have an
                encoding. */
             goto _readline_errors;
-        stdin_encoding_str = _PyUnicode_AsString(stdin_encoding);
-        stdin_errors_str = _PyUnicode_AsString(stdin_errors);
+        stdin_encoding_str = PyUnicode_AsUTF8(stdin_encoding);
+        stdin_errors_str = PyUnicode_AsUTF8(stdin_errors);
         if (!stdin_encoding_str || !stdin_errors_str)
             goto _readline_errors;
         tmp = _PyObject_CallMethodId(fout, &PyId_flush, NULL);
@@ -1920,8 +1920,8 @@
             stdout_errors = _PyObject_GetAttrId(fout, &PyId_errors);
             if (!stdout_encoding || !stdout_errors)
                 goto _readline_errors;
-            stdout_encoding_str = _PyUnicode_AsString(stdout_encoding);
-            stdout_errors_str = _PyUnicode_AsString(stdout_errors);
+            stdout_encoding_str = PyUnicode_AsUTF8(stdout_encoding);
+            stdout_errors_str = PyUnicode_AsUTF8(stdout_errors);
             if (!stdout_encoding_str || !stdout_errors_str)
                 goto _readline_errors;
             stringpo = PyObject_Str(prompt);
diff --git a/Python/ceval.c b/Python/ceval.c
index 6bdc998..a9d7c2f 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -4712,7 +4712,7 @@
     if (PyMethod_Check(func))
         return PyEval_GetFuncName(PyMethod_GET_FUNCTION(func));
     else if (PyFunction_Check(func))
-        return _PyUnicode_AsString(((PyFunctionObject*)func)->func_name);
+        return PyUnicode_AsUTF8(((PyFunctionObject*)func)->func_name);
     else if (PyCFunction_Check(func))
         return ((PyCFunctionObject*)func)->m_ml->ml_name;
     else
@@ -5286,7 +5286,7 @@
     if (!obj)
         return;
 
-    obj_str = _PyUnicode_AsString(obj);
+    obj_str = PyUnicode_AsUTF8(obj);
     if (!obj_str)
         return;
 
diff --git a/Python/future.c b/Python/future.c
index d94b23d..9c1f430 100644
--- a/Python/future.c
+++ b/Python/future.c
@@ -21,7 +21,7 @@
     names = s->v.ImportFrom.names;
     for (i = 0; i < asdl_seq_LEN(names); i++) {
         alias_ty name = (alias_ty)asdl_seq_GET(names, i);
-        const char *feature = _PyUnicode_AsString(name->name);
+        const char *feature = PyUnicode_AsUTF8(name->name);
         if (!feature)
             return 0;
         if (strcmp(feature, FUTURE_NESTED_SCOPES) == 0) {
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c
index 71f23dd..a4f7f82 100644
--- a/Python/pylifecycle.c
+++ b/Python/pylifecycle.c
@@ -205,7 +205,7 @@
     if (!name)
         goto error;
 
-    name_utf8 = _PyUnicode_AsString(name);
+    name_utf8 = PyUnicode_AsUTF8(name);
     if (name_utf8 == NULL)
         goto error;
     name_str = _PyMem_RawStrdup(name_utf8);
@@ -1285,7 +1285,7 @@
     encoding_attr = PyObject_GetAttrString(std, "encoding");
     if (encoding_attr != NULL) {
         const char * std_encoding;
-        std_encoding = _PyUnicode_AsString(encoding_attr);
+        std_encoding = PyUnicode_AsUTF8(encoding_attr);
         if (std_encoding != NULL) {
             PyObject *codec_info = _PyCodec_Lookup(std_encoding);
             Py_XDECREF(codec_info);
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index 5b1b786..c881f90 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -171,7 +171,7 @@
         if (v && v != Py_None) {
             oenc = _PyObject_GetAttrId(v, &PyId_encoding);
             if (oenc)
-                enc = _PyUnicode_AsString(oenc);
+                enc = PyUnicode_AsUTF8(oenc);
             if (!enc)
                 PyErr_Clear();
         }
@@ -182,7 +182,7 @@
         if (v == NULL)
             PyErr_Clear();
         else if (PyUnicode_Check(v)) {
-            ps1 = _PyUnicode_AsString(v);
+            ps1 = PyUnicode_AsUTF8(v);
             if (ps1 == NULL) {
                 PyErr_Clear();
                 ps1 = "";
@@ -195,7 +195,7 @@
         if (w == NULL)
             PyErr_Clear();
         else if (PyUnicode_Check(w)) {
-            ps2 = _PyUnicode_AsString(w);
+            ps2 = PyUnicode_AsUTF8(w);
             if (ps2 == NULL) {
                 PyErr_Clear();
                 ps2 = "";
@@ -514,7 +514,7 @@
     char *text;
     char *nl;
 
-    text = _PyUnicode_AsString(text_obj);
+    text = PyUnicode_AsUTF8(text_obj);
     if (text == NULL)
         return;
 
diff --git a/Python/structmember.c b/Python/structmember.c
index 86d4c66..be2737d 100644
--- a/Python/structmember.c
+++ b/Python/structmember.c
@@ -252,7 +252,7 @@
         char *string;
         Py_ssize_t len;
 
-        string = _PyUnicode_AsStringAndSize(v, &len);
+        string = PyUnicode_AsUTF8AndSize(v, &len);
         if (string == NULL || len != 1) {
             PyErr_BadArgument();
             return -1;
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index e348b38..52034ff 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -114,7 +114,7 @@
     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 @@
     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);
         }