Rename PyUnicode_AsString -> _PyUnicode_AsString and
PyUnicode_AsStringAndSize -> _PyUnicode_AsStringAndSize to mark
them for interpreter internal use only.
We'll have to rework these APIs or create new ones for the
purpose of accessing the UTF-8 representation of Unicode objects
for 3.1.
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index 2ab1d46..a1777bd 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -803,7 +803,7 @@
encoding_attr = PyObject_GetAttrString(std, "encoding");
if (encoding_attr != NULL) {
const char * encoding;
- encoding = PyUnicode_AsString(encoding_attr);
+ encoding = _PyUnicode_AsString(encoding_attr);
if (encoding != NULL) {
_PyCodec_Lookup(encoding);
}
@@ -909,7 +909,7 @@
oenc = PyObject_GetAttrString(v, "encoding");
if (!oenc)
return -1;
- enc = PyUnicode_AsString(oenc);
+ enc = _PyUnicode_AsString(oenc);
}
v = PySys_GetObject("ps1");
if (v != NULL) {
@@ -917,7 +917,7 @@
if (v == NULL)
PyErr_Clear();
else if (PyUnicode_Check(v))
- ps1 = PyUnicode_AsString(v);
+ ps1 = _PyUnicode_AsString(v);
}
w = PySys_GetObject("ps2");
if (w != NULL) {
@@ -925,7 +925,7 @@
if (w == NULL)
PyErr_Clear();
else if (PyUnicode_Check(w))
- ps2 = PyUnicode_AsString(w);
+ ps2 = _PyUnicode_AsString(w);
}
arena = PyArena_New();
if (arena == NULL) {
@@ -1101,7 +1101,7 @@
goto finally;
if (v == Py_None)
*filename = NULL;
- else if (! (*filename = PyUnicode_AsString(v)))
+ else if (! (*filename = _PyUnicode_AsString(v)))
goto finally;
Py_DECREF(v);
@@ -1134,7 +1134,7 @@
if (v == Py_None)
*text = NULL;
else if (!PyUnicode_Check(v) ||
- !(*text = PyUnicode_AsString(v)))
+ !(*text = _PyUnicode_AsString(v)))
goto finally;
Py_DECREF(v);
return 1;
@@ -1357,7 +1357,7 @@
err = PyFile_WriteString("<unknown>", f);
}
else {
- char* modstr = PyUnicode_AsString(moduleName);
+ char* modstr = _PyUnicode_AsString(moduleName);
if (modstr && strcmp(modstr, "builtins"))
{
err = PyFile_WriteString(modstr, f);
@@ -1806,7 +1806,7 @@
if (value != NULL) {
u = PyObject_Str(value);
if (u != NULL) {
- msg = PyUnicode_AsString(u);
+ msg = _PyUnicode_AsString(u);
}
}
if (msg == NULL)