summaryrefslogtreecommitdiffstats
path: root/Objects/unicodeobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/unicodeobject.c')
-rw-r--r--Objects/unicodeobject.c33
1 files changed, 0 insertions, 33 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index c46ba4a..8eafdacf 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -15862,39 +15862,6 @@ unicode_iter(PyObject *seq)
return (PyObject *)it;
}
-Py_UNICODE*
-PyUnicode_AsUnicodeCopy(PyObject *unicode)
-{
- Py_UNICODE *u, *copy;
- Py_ssize_t len, size;
-
- if (!PyUnicode_Check(unicode)) {
- PyErr_BadArgument();
- return NULL;
- }
-_Py_COMP_DIAG_PUSH
-_Py_COMP_DIAG_IGNORE_DEPR_DECLS
- u = PyUnicode_AsUnicodeAndSize(unicode, &len);
-_Py_COMP_DIAG_POP
- if (u == NULL)
- return NULL;
- /* Ensure we won't overflow the size. */
- if (len > ((PY_SSIZE_T_MAX / (Py_ssize_t)sizeof(Py_UNICODE)) - 1)) {
- PyErr_NoMemory();
- return NULL;
- }
- size = len + 1; /* copy the null character */
- size *= sizeof(Py_UNICODE);
- copy = PyMem_Malloc(size);
- if (copy == NULL) {
- PyErr_NoMemory();
- return NULL;
- }
- memcpy(copy, u, size);
- return copy;
-}
-
-
static int
encode_wstr_utf8(wchar_t *wstr, char **str, const char *name)
{