-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
Correct error display in _testcapi/vectorcall.c #136258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make an issue for posterity.
Modules/_testcapi/vectorcall.c
Outdated
@@ -179,13 +179,13 @@ _testcapi_VectorCallClass_set_vectorcall_impl(PyObject *self, | |||
if (!PyObject_TypeCheck(self, type)) { | |||
return PyErr_Format( | |||
PyExc_TypeError, | |||
"expected %s instance", | |||
"expected %S instance", | |||
PyType_GetName(type)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This reference is leaked! This is an existing issue, but let's fix it in this PR.
Instead of using PyType_GetName
and %S
, let's just use %T
.
Use %N instead of %S and PyType_GetName.
Correct incorrect conversion specifier in test from %s to %S for
PyObject *
. I could have added a test, but that would be testing the test!