diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-11-22 01:27:30 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-11-22 01:27:30 (GMT) |
commit | 9d3b93ba305e8a83bf1cec5146def2078e40b1a5 (patch) | |
tree | d618d2ca564f2a027522b22491f4fec656fceb09 /Modules/_ctypes | |
parent | b84d723509d1b8c7e052f61117624627d334cf30 (diff) | |
download | cpython-9d3b93ba305e8a83bf1cec5146def2078e40b1a5.zip cpython-9d3b93ba305e8a83bf1cec5146def2078e40b1a5.tar.gz cpython-9d3b93ba305e8a83bf1cec5146def2078e40b1a5.tar.bz2 |
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()
Diffstat (limited to 'Modules/_ctypes')
-rw-r--r-- | Modules/_ctypes/_ctypes.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c index b45eea9..31906bf 100644 --- a/Modules/_ctypes/_ctypes.c +++ b/Modules/_ctypes/_ctypes.c @@ -4255,7 +4255,7 @@ Array_subscript(PyObject *_self, PyObject *item) wchar_t *dest; if (slicelen <= 0) - return PyUnicode_FromUnicode(NULL, 0); + return PyUnicode_New(0, 0); if (step == 1) { return PyUnicode_FromWideChar(ptr + start, slicelen); @@ -4930,7 +4930,7 @@ Pointer_subscript(PyObject *_self, PyObject *item) wchar_t *dest; if (len <= 0) - return PyUnicode_FromUnicode(NULL, 0); + return PyUnicode_New(0, 0); if (step == 1) { return PyUnicode_FromWideChar(ptr + start, len); |