diff options
author | Inada Naoki <songofacandy@gmail.com> | 2022-05-12 14:48:38 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-12 14:48:38 +0900 |
commit | f9c9354a7a173eaca2aa19e667b5cf12167b7fed (patch) | |
tree | eb0fdd3219f53c973f1a7dbbcb9f8b0e0babdf36 /Python/traceback.c | |
parent | 68fec31364e96d122aae0571c14683b4ddb0ebd0 (diff) | |
download | cpython-git-f9c9354a7a173eaca2aa19e667b5cf12167b7fed.tar.gz |
gh-92536: PEP 623: Remove wstr and legacy APIs from Unicode (GH-92537)
Diffstat (limited to 'Python/traceback.c')
-rw-r--r-- | Python/traceback.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/Python/traceback.c b/Python/traceback.c index 3ec0618af9..e76c9aa1a1 100644 --- a/Python/traceback.c +++ b/Python/traceback.c @@ -1077,7 +1077,6 @@ _Py_DumpASCII(int fd, PyObject *text) int truncated; int kind; void *data = NULL; - wchar_t *wstr = NULL; Py_UCS4 ch; if (!PyUnicode_Check(text)) @@ -1085,13 +1084,7 @@ _Py_DumpASCII(int fd, PyObject *text) size = ascii->length; kind = ascii->state.kind; - if (kind == PyUnicode_WCHAR_KIND) { - wstr = ascii->wstr; - if (wstr == NULL) - return; - size = _PyCompactUnicodeObject_CAST(text)->wstr_length; - } - else if (ascii->state.compact) { + if (ascii->state.compact) { if (ascii->state.ascii) data = ascii + 1; else @@ -1132,10 +1125,7 @@ _Py_DumpASCII(int fd, PyObject *text) } for (i=0; i < size; i++) { - if (kind != PyUnicode_WCHAR_KIND) - ch = PyUnicode_READ(kind, data, i); - else - ch = wstr[i]; + ch = PyUnicode_READ(kind, data, i); if (' ' <= ch && ch <= 126) { /* printable ASCII character */ char c = (char)ch; |