mirror of
https://github.com/python/cpython.git
synced 2025-08-30 05:35:08 +00:00
Use the new Unicode API
* Replace PyUnicode_FromUnicode(NULL, 0) by PyUnicode_New(0, 0) * Replce PyUnicode_FromUnicode(str, len) by PyUnicode_FromWideChar(str, len) * Replace Py_UNICODE by wchar_t * posix_putenv() uses PyUnicode_FromFormat() to create the string, instead of PyUnicode_FromUnicode() + _snwprintf()
This commit is contained in:
parent
b84d723509
commit
9d3b93ba30
10 changed files with 38 additions and 41 deletions
|
@ -3900,7 +3900,7 @@ socket_gethostname(PyObject *self, PyObject *unused)
|
|||
PyObject *result;
|
||||
|
||||
if (GetComputerNameExW(ComputerNamePhysicalDnsHostname, buf, &size))
|
||||
return PyUnicode_FromUnicode(buf, size);
|
||||
return PyUnicode_FromWideChar(buf, size);
|
||||
|
||||
if (GetLastError() != ERROR_MORE_DATA)
|
||||
return PyErr_SetFromWindowsErr(0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue