Skip to content
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

[mypyc] Avoid uses of _PyObject_CallMethodOneArg on 3.13 #17526

Merged
merged 2 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix Python 3.8
  • Loading branch information
JukkaL committed Jul 14, 2024
commit a1920522d007188b9fec0b3593de1b0f598d7e6c
2 changes: 1 addition & 1 deletion mypyc/lib-rt/dict_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 141,7 @@ static int CPyDict_UpdateGeneral(PyObject *dict, PyObject *stuff) {
if (name == NULL) {
return -1;
}
PyObject *res = _PyObject_CallMethodOneArg(dict, name, stuff);
PyObject *res = PyObject_CallMethodOneArg(dict, name, stuff);
return CPy_ObjectToStatus(res);
}

Expand Down
2 changes: 2 additions & 0 deletions mypyc/lib-rt/pythonsupport.h
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 401,8 @@ _CPyObject_HasAttrId(PyObject *v, _Py_Identifier *name) {
_PyObject_CallMethodIdObjArgs((self), (name), NULL)
#define _PyObject_CallMethodIdOneArg(self, name, arg) \
_PyObject_CallMethodIdObjArgs((self), (name), (arg), NULL)
Comment on lines 401 to 403
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should remove _PyObject_CallMethodIdNoArg and _PyObject_CallMethodIdOneArg here. _PyObject_CallMethodIdObjArgs is no longer exported in Python 3.13.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never mind, those are only used for < 3.9 anyway.

#define PyObject_CallMethodOneArg(self, name, arg) \
PyObject_CallMethodObjArgs((self), (name), (arg), NULL)
#endif

#if CPY_3_13_FEATURES
Expand Down
Loading