Skip to content

Commit 544b0a0

Browse files
committed
Use PyType_GetName
1 parent ea3050c commit 544b0a0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Modules/_ctypes/callproc.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,7 @@ void _ctypes_extend_error(PyObject *exc_class, const char *fmt, ...)
10191019

10201020
PyErr_Fetch(&tp, &v, &tb);
10211021
PyErr_NormalizeException(&tp, &v, &tb);
1022-
cls_str = PyUnicode_FromString(((PyTypeObject *)tp)->tp_name);
1022+
cls_str = PyType_GetName(tp);
10231023
if (cls_str) {
10241024
PyUnicode_AppendAndDel(&s, cls_str);
10251025
PyUnicode_AppendAndDel(&s, PyUnicode_FromString(": "));

0 commit comments

Comments
 (0)