mirror of
https://github.com/python/cpython.git
synced 2025-08-02 08:02:56 +00:00
bpo-36346: Undeprecate private function _PyUnicode_AsUnicode(). (GH-21336)
This commit is contained in:
parent
7fed75597f
commit
b3dd5cd4a3
8 changed files with 5 additions and 68 deletions
|
@ -3310,14 +3310,11 @@ _PyUnicode_WideCharString_Converter(PyObject *obj, void *ptr)
|
|||
}
|
||||
if (PyUnicode_Check(obj)) {
|
||||
#if USE_UNICODE_WCHAR_CACHE
|
||||
_Py_COMP_DIAG_PUSH
|
||||
_Py_COMP_DIAG_IGNORE_DEPR_DECLS
|
||||
*p = (wchar_t *)_PyUnicode_AsUnicode(obj);
|
||||
if (*p == NULL) {
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
_Py_COMP_DIAG_POP
|
||||
#else /* USE_UNICODE_WCHAR_CACHE */
|
||||
*p = PyUnicode_AsWideCharString(obj, NULL);
|
||||
if (*p == NULL) {
|
||||
|
@ -3349,14 +3346,11 @@ _PyUnicode_WideCharString_Opt_Converter(PyObject *obj, void *ptr)
|
|||
}
|
||||
if (PyUnicode_Check(obj)) {
|
||||
#if USE_UNICODE_WCHAR_CACHE
|
||||
_Py_COMP_DIAG_PUSH
|
||||
_Py_COMP_DIAG_IGNORE_DEPR_DECLS
|
||||
*p = (wchar_t *)_PyUnicode_AsUnicode(obj);
|
||||
if (*p == NULL) {
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
_Py_COMP_DIAG_POP
|
||||
#else /* USE_UNICODE_WCHAR_CACHE */
|
||||
*p = PyUnicode_AsWideCharString(obj, NULL);
|
||||
if (*p == NULL) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue