mirror of
https://github.com/python/cpython.git
synced 2025-09-18 06:30:38 +00:00
bpo-33818: PyExceptionClass_Name() will now return "const char *". (GH-7581)
This commit is contained in:
parent
08f127a3ca
commit
ceeef10cdb
6 changed files with 14 additions and 9 deletions
|
@ -140,10 +140,9 @@ PyAPI_FUNC(void) _PyErr_ChainExceptions(PyObject *, PyObject *, PyObject *);
|
|||
#define PyExceptionInstance_Check(x) \
|
||||
PyType_FastSubclass((x)->ob_type, Py_TPFLAGS_BASE_EXC_SUBCLASS)
|
||||
|
||||
PyAPI_FUNC(char *) PyExceptionClass_Name(PyObject *);
|
||||
PyAPI_FUNC(const char *) PyExceptionClass_Name(PyObject *);
|
||||
#ifndef Py_LIMITED_API
|
||||
#define PyExceptionClass_Name(x) \
|
||||
((char *)(((PyTypeObject *)(x))->tp_name))
|
||||
#define PyExceptionClass_Name(x) (((PyTypeObject*)(x))->tp_name)
|
||||
#endif
|
||||
|
||||
#define PyExceptionInstance_Class(x) ((PyObject*)((x)->ob_type))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue