mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Issue #19569: Compiler warnings are now emitted if use most of deprecated
functions.
This commit is contained in:
parent
6107f46bfb
commit
460bd0d284
18 changed files with 143 additions and 142 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue