]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Make PyUnicode_Copy() private => _PyUnicode_Copy()
authorVictor Stinner <victor.stinner@haypocalc.com>
Mon, 12 Dec 2011 00:53:47 +0000 (01:53 +0100)
committerVictor Stinner <victor.stinner@haypocalc.com>
Mon, 12 Dec 2011 00:53:47 +0000 (01:53 +0100)
Undocument the function.

Make also decode_utf8_errors() as private (static).

Doc/c-api/unicode.rst
Doc/whatsnew/3.3.rst
Include/unicodeobject.h
Objects/codeobject.c
Objects/unicodeobject.c

index 65d4af555e12429863671c53c239a33777e6c538..81ed54045868e75853f9f566fec1f3009bc9fce2 100644 (file)
@@ -386,13 +386,6 @@ APIs:
    .. versionadded:: 3.3
 
 
-.. c:function:: PyObject* PyUnicode_Copy(PyObject *unicode)
-
-   Get a new copy of a Unicode object.
-
-   .. versionadded:: 3.3
-
-
 .. c:function:: PyObject* PyUnicode_FromKindAndData(int kind, const void *buffer, \
                                                     Py_ssize_t size)
 
index 56a16da0ae364f2d512a3bac02de68dc06fee785..ae275fcc91990c9c14b42b0d177d17f7772285b9 100644 (file)
@@ -769,8 +769,8 @@ Unicode functions and methods using :c:type:`Py_UNICODE` and
  * :c:macro:`PyUnicode_GET_DATA_SIZE`: use
    ``PyUnicode_GET_LENGTH(str) * PyUnicode_KIND(str)`` (only work on ready
    strings)
- * :c:func:`PyUnicode_AsUnicodeCopy`: use :c:func:`PyUnicode_AsUCS4Copy`,
-   :c:func:`PyUnicode_AsWideCharString` or :c:func:`PyUnicode_Copy`
+ * :c:func:`PyUnicode_AsUnicodeCopy`: use :c:func:`PyUnicode_AsUCS4Copy` or
+   :c:func:`PyUnicode_AsWideCharString`
 
 Functions and macros manipulating Py_UNICODE* strings:
 
index be45b0277c5dc5f02312de0f70bddd81c1d2beeb..235c6772338f9a72e0901f40a924cee5f37f1458 100644 (file)
@@ -616,9 +616,11 @@ PyAPI_FUNC(int) _PyUnicode_Ready(
 #endif
 
 /* Get a copy of a Unicode string. */
-PyAPI_FUNC(PyObject*) PyUnicode_Copy(
+#ifndef Py_LIMITED_API
+PyAPI_FUNC(PyObject*) _PyUnicode_Copy(
     PyObject *unicode
     );
+#endif
 
 /* Copy character from one unicode object into another, this function performs
    character conversion when necessary and falls back to memcpy if possible.
index c5057bdeb944fbf91e5f1520d48cb61d9e52c2eb..550e28498d20658be44be7d9236f2191837ffc3b 100644 (file)
@@ -249,7 +249,7 @@ validate_and_copy_tuple(PyObject *tup)
             return NULL;
         }
         else {
-            item = PyUnicode_Copy(item);
+            item = _PyUnicode_Copy(item);
             if (item == NULL) {
                 Py_DECREF(newtuple);
                 return NULL;
index ddb7baa2de3568b9d9edae5de718fbf934125539..5c2d2a7d345cb87b11f005170ded9dfa789d4ebd 100644 (file)
@@ -497,7 +497,7 @@ unicode_result_unchanged(PyObject *unicode)
     }
     else
         /* Subtype -- return genuine unicode string with the same value. */
-        return PyUnicode_Copy(unicode);
+        return _PyUnicode_Copy(unicode);
 }
 
 #ifdef HAVE_MBCS
@@ -1961,7 +1961,7 @@ unicode_adjust_maxchar(PyObject **p_unicode)
 }
 
 PyObject*
-PyUnicode_Copy(PyObject *unicode)
+_PyUnicode_Copy(PyObject *unicode)
 {
     Py_ssize_t length;
     PyObject *copy;
@@ -2832,7 +2832,7 @@ PyUnicode_FromObject(register PyObject *obj)
     if (PyUnicode_Check(obj)) {
         /* For a Unicode subtype that's not a Unicode object,
            return a true Unicode object with the same data. */
-        return PyUnicode_Copy(obj);
+        return _PyUnicode_Copy(obj);
     }
     PyErr_Format(PyExc_TypeError,
                  "Can't convert '%.100s' object to str implicitly",
@@ -4333,7 +4333,7 @@ _ucs4loop:
             goto onError;                                           \
     } while (0)
 
-PyObject *
+static PyObject *
 decode_utf8_errors(const char *starts,
                    Py_ssize_t size,
                    const char *errors,
@@ -9231,7 +9231,7 @@ fixup(PyObject *self,
     Py_UCS4 maxchar_old, maxchar_new = 0;
     PyObject *v;
 
-    u = PyUnicode_Copy(self);
+    u = _PyUnicode_Copy(self);
     if (u == NULL)
         return NULL;
     maxchar_old = PyUnicode_MAX_CHAR_VALUE(u);
@@ -12753,7 +12753,7 @@ PyDoc_STRVAR(sizeof__doc__,
 static PyObject *
 unicode_getnewargs(PyObject *v)
 {
-    PyObject *copy = PyUnicode_Copy(v);
+    PyObject *copy = _PyUnicode_Copy(v);
     if (!copy)
         return NULL;
     return Py_BuildValue("(N)", copy);