Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-44094: Remove deprecated PyErr_ APIs. #26011

Merged
merged 2 commits into from
May 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions Include/cpython/pyerrors.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,6 @@ PyAPI_FUNC(void) _PyErr_GetExcInfo(PyThreadState *, PyObject **, PyObject **, Py

PyAPI_FUNC(void) _PyErr_ChainExceptions(PyObject *, PyObject *, PyObject *);

/* Convenience functions */

#ifdef MS_WINDOWS
Py_DEPRECATED(3.3)
PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithUnicodeFilename(
PyObject *, const Py_UNICODE *);
#endif /* MS_WINDOWS */

/* Like PyErr_Format(), but saves current exception as __context__ and
__cause__.
*/
Expand All @@ -108,16 +100,6 @@ PyAPI_FUNC(PyObject *) _PyErr_FormatFromCause(
...
);

#ifdef MS_WINDOWS
/* XXX redeclare to use WSTRING */
Py_DEPRECATED(3.3)
PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithUnicodeFilename(
int, const Py_UNICODE *);
Py_DEPRECATED(3.3)
PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithUnicodeFilename(
PyObject *,int, const Py_UNICODE *);
#endif

/* In exceptions.c */

/* Helper that attempts to replace the current exception with one of the
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Remove ``PyErr_SetFromErrnoWithUnicodeFilename()``,
``PyErr_SetFromWindowsErrWithUnicodeFilename()``, and
``PyErr_SetExcFromWindowsErrWithUnicodeFilename()``. They are not documented
and have been deprecated since Python 3.3.
36 changes: 0 additions & 36 deletions Python/errors.c
Original file line number Diff line number Diff line change
Expand Up @@ -776,17 +776,6 @@ PyErr_SetFromErrnoWithFilename(PyObject *exc, const char *filename)
return result;
}

#ifdef MS_WINDOWS
PyObject *
PyErr_SetFromErrnoWithUnicodeFilename(PyObject *exc, const Py_UNICODE *filename)
{
PyObject *name = filename ? PyUnicode_FromWideChar(filename, -1) : NULL;
PyObject *result = PyErr_SetFromErrnoWithFilenameObjects(exc, name, NULL);
Py_XDECREF(name);
return result;
}
#endif /* MS_WINDOWS */

PyObject *
PyErr_SetFromErrno(PyObject *exc)
{
Expand Down Expand Up @@ -887,20 +876,6 @@ PyObject *PyErr_SetExcFromWindowsErrWithFilename(
return ret;
}

PyObject *PyErr_SetExcFromWindowsErrWithUnicodeFilename(
PyObject *exc,
int ierr,
const Py_UNICODE *filename)
{
PyObject *name = filename ? PyUnicode_FromWideChar(filename, -1) : NULL;
PyObject *ret = PyErr_SetExcFromWindowsErrWithFilenameObjects(exc,
ierr,
name,
NULL);
Py_XDECREF(name);
return ret;
}

PyObject *PyErr_SetExcFromWindowsErr(PyObject *exc, int ierr)
{
return PyErr_SetExcFromWindowsErrWithFilename(exc, ierr, NULL);
Expand All @@ -924,17 +899,6 @@ PyObject *PyErr_SetFromWindowsErrWithFilename(
return result;
}

PyObject *PyErr_SetFromWindowsErrWithUnicodeFilename(
int ierr,
const Py_UNICODE *filename)
{
PyObject *name = filename ? PyUnicode_FromWideChar(filename, -1) : NULL;
PyObject *result = PyErr_SetExcFromWindowsErrWithFilenameObjects(
PyExc_OSError,
ierr, name, NULL);
Py_XDECREF(name);
return result;
}
#endif /* MS_WINDOWS */

PyObject *
Expand Down