bpo-33818: PyExceptionClass_Name() will now return "const char *". (GH-7581)

This commit is contained in:
Serhiy Storchaka 2018-06-15 11:09:43 +03:00 committed by GitHub
parent 08f127a3ca
commit ceeef10cdb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 14 additions and 9 deletions

View file

@ -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))