summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorInada Naoki <songofacandy@gmail.com>2020-06-30 03:23:07 (GMT)
committerGitHub <noreply@github.com>2020-06-30 03:23:07 (GMT)
commitb3332660adb02babb7e66e45310c66dc9a9a94da (patch)
tree4eb2b2e3e92d0821ddf20b286e995119d0ce1cb9 /Objects
parent2515a28230b1a011205f30263da6b01c6bd167a3 (diff)
downloadcpython-b3332660adb02babb7e66e45310c66dc9a9a94da.zip
cpython-b3332660adb02babb7e66e45310c66dc9a9a94da.tar.gz
cpython-b3332660adb02babb7e66e45310c66dc9a9a94da.tar.bz2
bpo-41123: Remove PyUnicode_AsUnicodeCopy (GH-21209)
Diffstat (limited to 'Objects')
-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)
{