summaryrefslogtreecommitdiff
path: root/Objects/exceptions.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/exceptions.c')
-rw-r--r--Objects/exceptions.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/Objects/exceptions.c b/Objects/exceptions.c
index 1b70be786a..42b3fc7bb1 100644
--- a/Objects/exceptions.c
+++ b/Objects/exceptions.c
@@ -116,13 +116,7 @@ BaseException_str(PyBaseExceptionObject *self)
static PyObject *
BaseException_repr(PyBaseExceptionObject *self)
{
- const char *name;
- const char *dot;
-
- name = Py_TYPE(self)->tp_name;
- dot = (const char *) strrchr(name, '.');
- if (dot != NULL) name = dot+1;
-
+ const char *name = _PyType_Name(Py_TYPE(self));
return PyUnicode_FromFormat("%s%R", name, self->args);
}