Skip to content

Commit b3dd5cd

Browse files
bpo-36346: Undeprecate private function _PyUnicode_AsUnicode(). (GH-21336)
1 parent 7fed755 commit b3dd5cd

File tree

8 files changed

+5
-68
lines changed

8 files changed

+5
-68
lines changed

Include/cpython/unicodeobject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
581581

582582
/* Similar to PyUnicode_AsUnicode(), but raises a ValueError if the string
583583
contains null characters. */
584-
Py_DEPRECATED(3.3) PyAPI_FUNC(const Py_UNICODE *) _PyUnicode_AsUnicode(
584+
PyAPI_FUNC(const Py_UNICODE *) _PyUnicode_AsUnicode(
585585
PyObject *unicode /* Unicode object */
586586
);
587587

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Mark ``Py_UNICODE_COPY``, ``Py_UNICODE_FILL``, ``PyUnicode_WSTR_LENGTH``,
2-
``PyUnicode_FromUnicode``, ``PyUnicode_AsUnicode``, ``_PyUnicode_AsUnicode``,
2+
``PyUnicode_FromUnicode``, ``PyUnicode_AsUnicode``,
33
and ``PyUnicode_AsUnicodeAndSize`` as deprecated in C. Remove ``Py_UNICODE_MATCH``
44
which was deprecated and broken since Python 3.3.

Modules/clinic/posixmodule.c.h

Lines changed: 1 addition & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Objects/unicodeobject.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3310,14 +3310,11 @@ _PyUnicode_WideCharString_Converter(PyObject *obj, void *ptr)
33103310
}
33113311
if (PyUnicode_Check(obj)) {
33123312
#if USE_UNICODE_WCHAR_CACHE
3313-
_Py_COMP_DIAG_PUSH
3314-
_Py_COMP_DIAG_IGNORE_DEPR_DECLS
33153313
*p = (wchar_t *)_PyUnicode_AsUnicode(obj);
33163314
if (*p == NULL) {
33173315
return 0;
33183316
}
33193317
return 1;
3320-
_Py_COMP_DIAG_POP
33213318
#else /* USE_UNICODE_WCHAR_CACHE */
33223319
*p = PyUnicode_AsWideCharString(obj, NULL);
33233320
if (*p == NULL) {
@@ -3349,14 +3346,11 @@ _PyUnicode_WideCharString_Opt_Converter(PyObject *obj, void *ptr)
33493346
}
33503347
if (PyUnicode_Check(obj)) {
33513348
#if USE_UNICODE_WCHAR_CACHE
3352-
_Py_COMP_DIAG_PUSH
3353-
_Py_COMP_DIAG_IGNORE_DEPR_DECLS
33543349
*p = (wchar_t *)_PyUnicode_AsUnicode(obj);
33553350
if (*p == NULL) {
33563351
return 0;
33573352
}
33583353
return 1;
3359-
_Py_COMP_DIAG_POP
33603354
#else /* USE_UNICODE_WCHAR_CACHE */
33613355
*p = PyUnicode_AsWideCharString(obj, NULL);
33623356
if (*p == NULL) {

PC/_msi.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -758,10 +758,7 @@ _msi_SummaryInformation_SetProperty_impl(msiobj *self, int field,
758758

759759
if (PyUnicode_Check(data)) {
760760
#if USE_UNICODE_WCHAR_CACHE
761-
_Py_COMP_DIAG_PUSH
762-
_Py_COMP_DIAG_IGNORE_DEPR_DECLS
763761
const WCHAR *value = _PyUnicode_AsUnicode(data);
764-
_Py_COMP_DIAG_POP
765762
#else /* USE_UNICODE_WCHAR_CACHE */
766763
WCHAR *value = PyUnicode_AsWideCharString(data, NULL);
767764
#endif /* USE_UNICODE_WCHAR_CACHE */

PC/clinic/_msi.c.h

Lines changed: 1 addition & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

PC/clinic/winreg.c.h

Lines changed: 1 addition & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Tools/clinic/clinic.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3414,10 +3414,7 @@ def parse_arg(self, argname, argnum):
34143414
goto exit;
34153415
}}}}
34163416
#if USE_UNICODE_WCHAR_CACHE
3417-
_Py_COMP_DIAG_PUSH
3418-
_Py_COMP_DIAG_IGNORE_DEPR_DECLS
34193417
{paramname} = _PyUnicode_AsUnicode({argname});
3420-
_Py_COMP_DIAG_POP
34213418
#else /* USE_UNICODE_WCHAR_CACHE */
34223419
{paramname} = PyUnicode_AsWideCharString({argname}, NULL);
34233420
#endif /* USE_UNICODE_WCHAR_CACHE */
@@ -3432,10 +3429,7 @@ def parse_arg(self, argname, argnum):
34323429
}}}}
34333430
else if (PyUnicode_Check({argname})) {{{{
34343431
#if USE_UNICODE_WCHAR_CACHE
3435-
_Py_COMP_DIAG_PUSH
3436-
_Py_COMP_DIAG_IGNORE_DEPR_DECLS
34373432
{paramname} = _PyUnicode_AsUnicode({argname});
3438-
_Py_COMP_DIAG_POP
34393433
#else /* USE_UNICODE_WCHAR_CACHE */
34403434
{paramname} = PyUnicode_AsWideCharString({argname}, NULL);
34413435
#endif /* USE_UNICODE_WCHAR_CACHE */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy