summaryrefslogtreecommitdiffstats
path: root/Objects/funcobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/funcobject.c')
-rw-r--r--Objects/funcobject.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/Objects/funcobject.c b/Objects/funcobject.c
index 32b4155..7f257a9 100644
--- a/Objects/funcobject.c
+++ b/Objects/funcobject.c
@@ -134,6 +134,9 @@ uint32_t _PyFunction_GetVersionForCurrentState(PyFunctionObject *func)
if (func->func_version != 0) {
return func->func_version;
}
+ if (func->vectorcall != _PyFunction_Vectorcall) {
+ return 0;
+ }
if (next_func_version == 0) {
return 0;
}
@@ -209,6 +212,14 @@ PyFunction_SetDefaults(PyObject *op, PyObject *defaults)
return 0;
}
+void
+PyFunction_SetVectorcall(PyFunctionObject *func, vectorcallfunc vectorcall)
+{
+ assert(func != NULL);
+ func->func_version = 0;
+ func->vectorcall = vectorcall;
+}
+
PyObject *
PyFunction_GetKwDefaults(PyObject *op)
{