[3.14] gh-136288: Fix error message in _testcapi/vectorcall.c (GH-136258) (GH-136294)

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 d1d5dce14f)

Co-authored-by: William S Fulton <wsf@fultondesigns.co.uk>
This commit is contained in:
Miss Islington (bot) 2025-07-04 18:18:32 +02:00 committed by GitHub
parent 1a2898a383
commit 6d21cc54ff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -179,14 +179,14 @@ _testcapi_VectorCallClass_set_vectorcall_impl(PyObject *self,
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);