https://github.com/python/cpython/commit/a717ed986dd8853fd6a27ee4830e72e6cb3c6c0a
commit: a717ed986dd8853fd6a27ee4830e72e6cb3c6c0a
branch: 3.13
author: Miss Islington (bot) <31488909+miss-isling...@users.noreply.github.com>
committer: ZeroIntensity <zintensity...@gmail.com>
date: 2025-07-04T16:17:10Z
summary:

[3.13] gh-136288: Fix error message in `_testcapi/vectorcall.c` (GH-136258) 
(GH-136295)

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 <w...@fultondesigns.co.uk>

files:
M Modules/_testcapi/vectorcall.c

diff --git a/Modules/_testcapi/vectorcall.c b/Modules/_testcapi/vectorcall.c
index 03aaacb328e0b6..f89dcb6c4cf03c 100644
--- a/Modules/_testcapi/vectorcall.c
+++ b/Modules/_testcapi/vectorcall.c
@@ -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);

_______________________________________________
Python-checkins mailing list -- python-checkins@python.org
To unsubscribe send an email to python-checkins-le...@python.org
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: arch...@mail-archive.com

Reply via email to