]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Uncomment Py_DEPRECATED for Py_UNICODE APIs (GH-21318)
authorInada Naoki <songofacandy@gmail.com>
Sun, 5 Jul 2020 02:01:54 +0000 (11:01 +0900)
committerGitHub <noreply@github.com>
Sun, 5 Jul 2020 02:01:54 +0000 (11:01 +0900)
PyUnicode_EncodeDecimal and PyUnicode_TransformDecimalToASCII
are deprecated since Python 3.3.
But Py_DEPRECATED(3.3) was commented out.

Include/cpython/unicodeobject.h
Modules/_testcapimodule.c

index 0f19b2a14bcd0a619ab18b8eb487bf030203e5c4..a82eee45e0ed2e02ec9d439d33c36c5190509f5f 100644 (file)
@@ -974,7 +974,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 */
@@ -987,7 +987,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 */
index 629102b12a9fe2f647c9a87efa42f613685c7b4b..1e4c31fefb206f15c0b951b39f6c2424b0d1f22e 100644 (file)
@@ -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)
 {