diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2020-07-05 02:19:40 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-05 02:19:40 (GMT) |
commit | 9c3840870814493fed62e140cfa43c2883e12181 (patch) | |
tree | 7cdd3e5a8f3fdfd5dd6383f5f42d5d86ce24d87d | |
parent | 1cbcf9833f26588a16b5b69d202df727dbd09968 (diff) | |
download | cpython-9c3840870814493fed62e140cfa43c2883e12181.zip cpython-9c3840870814493fed62e140cfa43c2883e12181.tar.gz cpython-9c3840870814493fed62e140cfa43c2883e12181.tar.bz2 |
Uncomment Py_DEPRECATED for Py_UNICODE APIs (GH-21318)
PyUnicode_EncodeDecimal and PyUnicode_TransformDecimalToASCII
are deprecated since Python 3.3.
But Py_DEPRECATED(3.3) was commented out.
(cherry picked from commit 13c90e82b6a1c3baff7f48f1bdc38058f6072f04)
Co-authored-by: Inada Naoki <songofacandy@gmail.com>
-rw-r--r-- | Include/cpython/unicodeobject.h | 4 | ||||
-rw-r--r-- | Modules/_testcapimodule.c | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/Include/cpython/unicodeobject.h b/Include/cpython/unicodeobject.h index a9b754a..30a7e78 100644 --- a/Include/cpython/unicodeobject.h +++ b/Include/cpython/unicodeobject.h @@ -979,7 +979,7 @@ Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject*) PyUnicode_EncodeMBCS( */ -/* Py_DEPRECATED(3.3) */ PyAPI_FUNC(int) PyUnicode_EncodeDecimal( +Py_DEPRECATED(3.3) PyAPI_FUNC(int) PyUnicode_EncodeDecimal( Py_UNICODE *s, /* Unicode buffer */ Py_ssize_t length, /* Number of Py_UNICODE chars to encode */ char *output, /* Output buffer; must have size >= length */ @@ -992,7 +992,7 @@ Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject*) PyUnicode_EncodeMBCS( Returns a new Unicode string on success, NULL on failure. */ -/* Py_DEPRECATED(3.3) */ +Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject*) PyUnicode_TransformDecimalToASCII( Py_UNICODE *s, /* Unicode buffer */ Py_ssize_t length /* Number of Py_UNICODE chars to transform */ diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index c92a71a..b2d070c 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -2024,6 +2024,10 @@ unicode_copycharacters(PyObject *self, PyObject *args) return Py_BuildValue("(Nn)", to_copy, copied); } +/* Ignore use of deprecated APIs */ +_Py_COMP_DIAG_PUSH +_Py_COMP_DIAG_IGNORE_DEPR_DECLS + static PyObject * unicode_encodedecimal(PyObject *self, PyObject *args) { @@ -2069,10 +2073,6 @@ unicode_transformdecimaltoascii(PyObject *self, PyObject *args) return PyUnicode_TransformDecimalToASCII(unicode, length); } -/* Ignore use of deprecated APIs */ -_Py_COMP_DIAG_PUSH -_Py_COMP_DIAG_IGNORE_DEPR_DECLS - static PyObject * unicode_legacy_string(PyObject *self, PyObject *args) { |