diff --git a/Objects/funcobject.c b/Objects/funcobject.c index 32b4155c03e6ae..6eee00e7b9414c 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; }