gh-136288: Fix error message in `_testcapi/vectorcall.c` (GH-136258)
Use the %N format specifier instead of %s and `PyType_GetName`.
(cherry picked from commit
d1d5dce14f90d777608e4403d09079421ff55944)
Co-authored-by: William S Fulton <wsf@fultondesigns.co.uk>
if (!PyObject_TypeCheck(self, type)) {
return PyErr_Format(
PyExc_TypeError,
- "expected %s instance",
- PyType_GetName(type));
+ "expected %N instance",
+ type);
}
if (!type->tp_vectorcall_offset) {
return PyErr_Format(
PyExc_TypeError,
- "type %s has no vectorcall offset",
- PyType_GetName(type));
+ "type %N has no vectorcall offset",
+ type);
}
*(vectorcallfunc*)((char*)self + type->tp_vectorcall_offset) = (
VectorCallClass_vectorcall);