mirror of
https://github.com/python/cpython.git
synced 2025-10-12 01:43:12 +00:00
bpo-40170: Always define PyExceptionClass_Name() as a function (GH-24553)
Remove macro variant of PyExceptionClass_Name().
This commit is contained in:
parent
801bb0b503
commit
cd80f430da
3 changed files with 3 additions and 6 deletions
|
@ -78,10 +78,6 @@ PyAPI_FUNC(void) _PyErr_GetExcInfo(PyThreadState *, PyObject **, PyObject **, Py
|
||||||
|
|
||||||
PyAPI_FUNC(void) _PyErr_ChainExceptions(PyObject *, PyObject *, PyObject *);
|
PyAPI_FUNC(void) _PyErr_ChainExceptions(PyObject *, PyObject *, PyObject *);
|
||||||
|
|
||||||
/* */
|
|
||||||
|
|
||||||
#define PyExceptionClass_Name(x) (((PyTypeObject*)(x))->tp_name)
|
|
||||||
|
|
||||||
/* Convenience functions */
|
/* Convenience functions */
|
||||||
|
|
||||||
#ifdef MS_WINDOWS
|
#ifdef MS_WINDOWS
|
||||||
|
|
|
@ -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.
|
|
@ -364,8 +364,6 @@ PyException_SetContext(PyObject *self, PyObject *context)
|
||||||
Py_XSETREF(_PyBaseExceptionObject_cast(self)->context, context);
|
Py_XSETREF(_PyBaseExceptionObject_cast(self)->context, context);
|
||||||
}
|
}
|
||||||
|
|
||||||
#undef PyExceptionClass_Name
|
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
PyExceptionClass_Name(PyObject *ob)
|
PyExceptionClass_Name(PyObject *ob)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue