mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
[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:
parent
1a2898a383
commit
6d21cc54ff
1 changed files with 4 additions and 4 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue