Skip to content

Commit

Permalink
Use _PyObject_Vectorcall on Python 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
fangerer committed Apr 3, 2023
1 parent 6588d87 commit b4329f3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions hpy/devel/include/hpy/cpython/misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,10 @@ HPyAPI_FUNC HPy HPy_CallTupleDict(HPyContext *ctx, HPy callable, HPy args, HPy k
return ctx_CallTupleDict(ctx, callable, args, kw);
}

#if PY_VERSION_HEX < 0x03090000
#define PyObject_Vectorcall _PyObject_Vectorcall
#endif

HPyAPI_FUNC HPy HPy_Call(HPyContext *ctx, HPy callable, const HPy *args, size_t nargs, HPy kwnames)
{
if (sizeof(HPy) == sizeof(PyObject *)) {
Expand All @@ -284,6 +288,10 @@ HPyAPI_FUNC HPy HPy_Call(HPyContext *ctx, HPy callable, const HPy *args, size_t
return ctx_Call(ctx, callable, args, nargs, kwnames);
}

#if PY_VERSION_HEX < 0x03090000
#undef PyObject_Vectorcall
#endif

HPyAPI_FUNC HPy HPy_CallMethod(HPyContext *ctx, HPy name, const HPy *args, size_t nargs, HPy kwnames)
{
#if PY_VERSION_HEX >= 0x03090000
Expand Down

0 comments on commit b4329f3

Please sign in to comment.