Issue #19569: Compiler warnings are now emitted if use most of deprecated

functions.
This commit is contained in:
Serhiy Storchaka 2016-11-20 12:16:46 +02:00
parent 6107f46bfb
commit 460bd0d284
18 changed files with 143 additions and 142 deletions

View file

@ -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;
}