8000 bpo-40170: Always define PyExceptionClass_Name as a function by erlend-aasland · Pull Request #24553 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-40170: Always define PyExceptionClass_Name as a function #24553

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

Merged
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
4 changes: 0 additions & 4 deletions Include/cpython/pyerrors.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,6 @@ PyAPI_FUNC(void) _PyErr_GetExcInfo(PyThreadState *, PyObject **, PyObject **, Py

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

/* */

#define PyExceptionClass_Name(x) (((PyTypeObject*)(x))->tp_name)

/* Convenience functions */

#ifdef MS_WINDOWS
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
:c:func:`PyExceptionClass_Name` is now always declared as a function, in
order to hide implementation details. The macro accessed
:c:member:`PyTypeObject.tp_name` directly. Patch by Erlend E. Aasland.
2 changes: 0 additions & 2 deletions Objects/exceptions.c
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,6 @@ PyException_SetContext(PyObject *self, PyObject *context)
Py_XSETREF(_PyBaseExceptionObject_cast(self)->context, context);
}

#undef PyExceptionClass_Name

const char *
PyExceptionClass_Name(PyObject *ob)
{
Expand Down
0