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 /Python/errors.c | |
parent | 6107f46bfbe4aa7b2ddb37ca5136d1d472c3f4aa (diff) | |
download | cpython-git-460bd0d284caa00eb8ccc9a28836ba30765a19cb.tar.gz |
Issue #19569: Compiler warnings are now emitted if use most of deprecated
functions.
Diffstat (limited to 'Python/errors.c')
-rw-r--r-- | Python/errors.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/Python/errors.c b/Python/errors.c index 1463cdca3f..01304d25a1 100644 --- a/Python/errors.c +++ b/Python/errors.c @@ -582,9 +582,7 @@ PyErr_SetFromErrnoWithFilename(PyObject *exc, const char *filename) PyObject * PyErr_SetFromErrnoWithUnicodeFilename(PyObject *exc, const Py_UNICODE *filename) { - PyObject *name = filename ? - PyUnicode_FromUnicode(filename, wcslen(filename)) : - NULL; + PyObject *name = filename ? PyUnicode_FromWideChar(filename, -1) : NULL; PyObject *result = PyErr_SetFromErrnoWithFilenameObjects(exc, name, NULL); Py_XDECREF(name); return result; @@ -691,9 +689,7 @@ PyObject *PyErr_SetExcFromWindowsErrWithUnicodeFilename( int ierr, const Py_UNICODE *filename) { - PyObject *name = filename ? - PyUnicode_FromUnicode(filename, wcslen(filename)) : - NULL; + PyObject *name = filename ? PyUnicode_FromWideChar(filename, -1) : NULL; PyObject *ret = PyErr_SetExcFromWindowsErrWithFilenameObjects(exc, ierr, name, @@ -729,9 +725,7 @@ PyObject *PyErr_SetFromWindowsErrWithUnicodeFilename( int ierr, const Py_UNICODE *filename) { - PyObject *name = filename ? - PyUnicode_FromUnicode(filename, wcslen(filename)) : - NULL; + PyObject *name = filename ? PyUnicode_FromWideChar(filename, -1) : NULL; PyObject *result = PyErr_SetExcFromWindowsErrWithFilenameObjects( PyExc_OSError, ierr, name, NULL); |