Skip to content

Commit d1d5dce

Browse files
authored
gh-136288: Fix error message in _testcapi/vectorcall.c (GH-136258)
Use the %N format specifier instead of %s and `PyType_GetName`.
1 parent ade1988 commit d1d5dce

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Modules/_testcapi/vectorcall.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,14 +179,14 @@ _testcapi_VectorCallClass_set_vectorcall_impl(PyObject *self,
179179
if (!PyObject_TypeCheck(self, type)) {
180180
return PyErr_Format(
181181
PyExc_TypeError,
182-
"expected %s instance",
183-
PyType_GetName(type));
182+
"expected %N instance",
183+
type);
184184
}
185185
if (!type->tp_vectorcall_offset) {
186186
return PyErr_Format(
187187
PyExc_TypeError,
188-
"type %s has no vectorcall offset",
189-
PyType_GetName(type));
188+
"type %N has no vectorcall offset",
189+
type);
190190
}
191191
*(vectorcallfunc*)((char*)self + type->tp_vectorcall_offset) = (
192192
VectorCallClass_vectorcall);

0 commit comments

Comments
 (0)