mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Add PyUnicode_Copy() function, include it to the public API
This commit is contained in:
parent
b153615008
commit
034f6cf10c
3 changed files with 27 additions and 21 deletions
|
@ -729,8 +729,7 @@ convert_to_unicode(PyObject **param)
|
|||
else if (PyUnicode_Check(*param))
|
||||
/* For a Unicode subtype that's not a Unicode object,
|
||||
return a true Unicode object with the same data. */
|
||||
*param = PyUnicode_FromUnicode(PyUnicode_AS_UNICODE(*param),
|
||||
PyUnicode_GET_SIZE(*param));
|
||||
*param = PyUnicode_Copy(*param);
|
||||
else
|
||||
*param = PyUnicode_FromEncodedObject(*param,
|
||||
Py_FileSystemDefaultEncoding,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue