mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
parent
b9279bc88f
commit
790465fd90
21 changed files with 642 additions and 414 deletions
|
@ -553,10 +553,16 @@ PyObject *PyUnicode_FromWideChar(register const wchar_t *w,
|
|||
PyUnicodeObject *unicode;
|
||||
|
||||
if (w == NULL) {
|
||||
if (size == 0)
|
||||
return PyUnicode_FromStringAndSize(NULL, 0);
|
||||
PyErr_BadInternalCall();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (size == -1) {
|
||||
size = wcslen(w);
|
||||
}
|
||||
|
||||
unicode = _PyUnicode_New(size);
|
||||
if (!unicode)
|
||||
return NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue