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_SetFromErrno(PyObject *);
|
||||||
PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilenameObject(
|
PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilenameObject(
|
||||||
PyObject *, PyObject *);
|
PyObject *, PyObject *);
|
||||||
PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilename(PyObject *, char *);
|
PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilename(
|
||||||
|
PyObject *, const char *);
|
||||||
#ifdef MS_WINDOWS
|
#ifdef MS_WINDOWS
|
||||||
PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithUnicodeFilename(
|
PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithUnicodeFilename(
|
||||||
PyObject *, Py_UNICODE *);
|
PyObject *, const Py_UNICODE *);
|
||||||
#endif /* MS_WINDOWS */
|
#endif /* MS_WINDOWS */
|
||||||
|
|
||||||
PyAPI_FUNC(PyObject *) PyErr_Format(PyObject *, const char *, ...)
|
PyAPI_FUNC(PyObject *) PyErr_Format(PyObject *, const char *, ...)
|
||||||
|
|
|
@ -371,7 +371,7 @@ PyErr_SetFromErrnoWithFilenameObject(PyObject *exc, PyObject *filenameObject)
|
||||||
|
|
||||||
|
|
||||||
PyObject *
|
PyObject *
|
||||||
PyErr_SetFromErrnoWithFilename(PyObject *exc, char *filename)
|
PyErr_SetFromErrnoWithFilename(PyObject *exc, const char *filename)
|
||||||
{
|
{
|
||||||
PyObject *name = filename ? PyString_FromString(filename) : NULL;
|
PyObject *name = filename ? PyString_FromString(filename) : NULL;
|
||||||
PyObject *result = PyErr_SetFromErrnoWithFilenameObject(exc, name);
|
PyObject *result = PyErr_SetFromErrnoWithFilenameObject(exc, name);
|
||||||
|
@ -381,7 +381,7 @@ PyErr_SetFromErrnoWithFilename(PyObject *exc, char *filename)
|
||||||
|
|
||||||
#ifdef MS_WINDOWS
|
#ifdef MS_WINDOWS
|
||||||
PyObject *
|
PyObject *
|
||||||
PyErr_SetFromErrnoWithUnicodeFilename(PyObject *exc, Py_UNICODE *filename)
|
PyErr_SetFromErrnoWithUnicodeFilename(PyObject *exc, const Py_UNICODE *filename)
|
||||||
{
|
{
|
||||||
PyObject *name = filename ?
|
PyObject *name = filename ?
|
||||||
PyUnicode_FromUnicode(filename, wcslen(filename)) :
|
PyUnicode_FromUnicode(filename, wcslen(filename)) :
|
||||||
|
|
Loading…
Reference in New Issue