diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-11-20 12:16:46 +0200 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-11-20 12:16:46 +0200 |
commit | 460bd0d284caa00eb8ccc9a28836ba30765a19cb (patch) | |
tree | 41169cfce0d00587f4222d3237a608b70577adfc /Modules/_testcapimodule.c | |
parent | 6107f46bfbe4aa7b2ddb37ca5136d1d472c3f4aa (diff) | |
download | cpython-460bd0d284caa00eb8ccc9a28836ba30765a19cb.tar.gz cpython-460bd0d284caa00eb8ccc9a28836ba30765a19cb.zip |
Issue #19569: Compiler warnings are now emitted if use most of deprecated
functions.
Diffstat (limited to 'Modules/_testcapimodule.c')
-rw-r--r-- | Modules/_testcapimodule.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index c53e0799392..8ad54dd4f15 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -1398,11 +1398,9 @@ static PyObject * getargs_u(PyObject *self, PyObject *args) { Py_UNICODE *str; - Py_ssize_t size; if (!PyArg_ParseTuple(args, "u", &str)) return NULL; - size = Py_UNICODE_strlen(str); - return PyUnicode_FromUnicode(str, size); + return PyUnicode_FromWideChar(str, -1); } static PyObject * @@ -1412,19 +1410,17 @@ getargs_u_hash(PyObject *self, PyObject *args) Py_ssize_t size; if (!PyArg_ParseTuple(args, "u#", &str, &size)) return NULL; - return PyUnicode_FromUnicode(str, size); + return PyUnicode_FromWideChar(str, size); } static PyObject * getargs_Z(PyObject *self, PyObject *args) { Py_UNICODE *str; - Py_ssize_t size; if (!PyArg_ParseTuple(args, "Z", &str)) return NULL; if (str != NULL) { - size = Py_UNICODE_strlen(str); - return PyUnicode_FromUnicode(str, size); + return PyUnicode_FromWideChar(str, -1); } else Py_RETURN_NONE; } @@ -1437,7 +1433,7 @@ getargs_Z_hash(PyObject *self, PyObject *args) if (!PyArg_ParseTuple(args, "Z#", &str, &size)) return NULL; if (str != NULL) - return PyUnicode_FromUnicode(str, size); + return PyUnicode_FromWideChar(str, size); else Py_RETURN_NONE; } |