mirror of
https://github.com/python/cpython.git
synced 2025-07-15 07:15:18 +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
|
@ -947,7 +947,7 @@ PyErr_WriteUnraisable(PyObject *obj)
|
|||
_Py_IDENTIFIER(__module__);
|
||||
PyObject *f, *t, *v, *tb;
|
||||
PyObject *moduleName = NULL;
|
||||
char* className;
|
||||
const char *className;
|
||||
|
||||
PyErr_Fetch(&t, &v, &tb);
|
||||
|
||||
|
@ -977,7 +977,7 @@ PyErr_WriteUnraisable(PyObject *obj)
|
|||
assert(PyExceptionClass_Check(t));
|
||||
className = PyExceptionClass_Name(t);
|
||||
if (className != NULL) {
|
||||
char *dot = strrchr(className, '.');
|
||||
const char *dot = strrchr(className, '.');
|
||||
if (dot != NULL)
|
||||
className = dot+1;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue