Mercurial > cpython-lru_cache-weakref
diff Python/pythonrun.c @ 48660:85b67fb5672b
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.
| author | Marc-André Lemburg <mal@egenix.com> |
|---|---|
| date | Thu, 07 Aug 2008 18:54:33 +0000 |
| parents | b51cd5d3795c |
| children | 587cd4f66c2d |
line wrap: on
line diff
--- a/Python/pythonrun.c Thu Aug 07 18:47:28 2008 +0000 +++ b/Python/pythonrun.c Thu Aug 07 18:54:33 2008 +0000 @@ -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)
