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

@ -774,12 +774,12 @@ print_exception(PyObject *f, PyObject *value)
}
else {
PyObject* moduleName;
char* className;
const char *className;
_Py_IDENTIFIER(__module__);
assert(PyExceptionClass_Check(type));
className = PyExceptionClass_Name(type);
if (className != NULL) {
char *dot = strrchr(className, '.');
const char *dot = strrchr(className, '.');
if (dot != NULL)
className = dot+1;
}