@@ -2399,6 +2399,25 @@ simple_pending_call(PyObject *self, PyObject *callable)
23992399 Py_RETURN_NONE ;
24002400}
24012401
2402+ static PyObject *
2403+ vectorcall_nop (PyObject * callable , PyObject * const * args ,
2404+ size_t nargsf , PyObject * kwnames )
2405+ {
2406+ Py_RETURN_NONE ;
2407+ }
2408+
2409+ static PyObject *
2410+ set_vectorcall_nop (PyObject * self , PyObject * func )
2411+ {
2412+ if (!PyFunction_Check (func )) {
2413+ PyErr_SetString (PyExc_TypeError , "expected function" );
2414+ return NULL ;
2415+ }
2416+
2417+ ((PyFunctionObject * )func )-> vectorcall = vectorcall_nop ;
2418+ Py_RETURN_NONE ;
2419+ }
2420+
24022421static PyMethodDef module_functions [] = {
24032422 {"get_configs" , get_configs , METH_NOARGS },
24042423 {"get_recursion_depth" , get_recursion_depth , METH_NOARGS },
@@ -2507,6 +2526,7 @@ static PyMethodDef module_functions[] = {
25072526 {"emscripten_set_up_async_input_device" , emscripten_set_up_async_input_device , METH_NOARGS },
25082527#endif
25092528 {"simple_pending_call ", simple_pending_call , METH_O },
2529+ {"set_vectorcall_nop ", set_vectorcall_nop , METH_O },
25102530 {NULL, NULL } /* sentinel */
25112531};
25122532
0 commit comments