Add const qualifier to PyErr_SetFromErrnoWithFilename and to
PyErr_SetFromErrnoWithUnicodeFilename.
This commit is contained in:
parent
c5ae86b9d3
commit
a6e3474d02
|
@ -185,10 +185,11 @@ PyAPI_FUNC(PyObject *) PyErr_NoMemory(void);
|
|||
PyAPI_FUNC(PyObject *) PyErr_SetFromErrno(PyObject *);
|
||||
PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilenameObject(
|
||||
PyObject *, PyObject *);
|
||||
PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilename(PyObject *, char *);
|
||||
PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilename(
|
||||
PyObject *, const char *);
|
||||
#ifdef MS_WINDOWS
|
||||
PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithUnicodeFilename(
|
||||
PyObject *, Py_UNICODE *);
|
||||
PyObject *, const Py_UNICODE *);
|
||||
#endif /* MS_WINDOWS */
|
||||
|
||||
PyAPI_FUNC(PyObject *) PyErr_Format(PyObject *, const char *, ...)
|
||||
|
|
|
@ -371,7 +371,7 @@ PyErr_SetFromErrnoWithFilenameObject(PyObject *exc, PyObject *filenameObject)
|
|||
|
||||
|
||||
PyObject *
|
||||
PyErr_SetFromErrnoWithFilename(PyObject *exc, char *filename)
|
||||
PyErr_SetFromErrnoWithFilename(PyObject *exc, const char *filename)
|
||||
{
|
||||
PyObject *name = filename ? PyString_FromString(filename) : NULL;
|
||||
PyObject *result = PyErr_SetFromErrnoWithFilenameObject(exc, name);
|
||||
|
@ -381,7 +381,7 @@ PyErr_SetFromErrnoWithFilename(PyObject *exc, char *filename)
|
|||
|
||||
#ifdef MS_WINDOWS
|
||||
PyObject *
|
||||
PyErr_SetFromErrnoWithUnicodeFilename(PyObject *exc, Py_UNICODE *filename)
|
||||
PyErr_SetFromErrnoWithUnicodeFilename(PyObject *exc, const Py_UNICODE *filename)
|
||||
{
|
||||
PyObject *name = filename ?
|
||||
PyUnicode_FromUnicode(filename, wcslen(filename)) :
|
||||
|
|
Loading…
Reference in New Issue