diff --git a/src/App/FeaturePythonPyImp.h b/src/App/FeaturePythonPyImp.h index dcc4d94ab7..0fbb04abf3 100644 --- a/src/App/FeaturePythonPyImp.h +++ b/src/App/FeaturePythonPyImp.h @@ -45,7 +45,9 @@ virtual ~_class_(); \ }; -#if PY_VERSION_HEX >= 0x03090000 +#if PY_VERSION_HEX >= 0x030c0000 +#define PYTHON_TYPE_SLOTS 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +#elif PY_VERSION_HEX >= 0x03090000 #define PYTHON_TYPE_SLOTS 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 #elif PY_VERSION_HEX >= 0x03080000 #define PYTHON_TYPE_SLOTS 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 diff --git a/src/App/FeaturePythonPyImp.inl b/src/App/FeaturePythonPyImp.inl index 8abfda8b34..afff283d73 100644 --- a/src/App/FeaturePythonPyImp.inl +++ b/src/App/FeaturePythonPyImp.inl @@ -84,6 +84,9 @@ PyTypeObject FeaturePythonPyT::Type = { nullptr /*tp_finalize */ #if PY_VERSION_HEX >= 0x03080000 ,0 /*tp_vectorcall */ +#if PY_VERSION_HEX >= 0x030c0000 + ,0 /*tp_watched */ +#endif #endif }; diff --git a/src/Base/PyObjectBase.cpp b/src/Base/PyObjectBase.cpp index 0c4000ddfa..be96008764 100644 --- a/src/Base/PyObjectBase.cpp +++ b/src/Base/PyObjectBase.cpp @@ -170,6 +170,9 @@ static PyTypeObject PyBaseProxyType = { nullptr /*tp_finalize */ #if PY_VERSION_HEX >= 0x03090000 ,0 //NOLINT /*tp_vectorcall */ +#if PY_VERSION_HEX >= 0x030c0000 + ,0 /*tp_watched */ +#endif #elif PY_VERSION_HEX >= 0x03080000 ,0 /*tp_vectorcall */ /* bpo-37250: kept for backwards compatibility in CPython 3.8 only */ @@ -235,6 +238,9 @@ PyTypeObject PyObjectBase::Type = { nullptr /*tp_finalize */ #if PY_VERSION_HEX >= 0x03090000 ,0 //NOLINT /*tp_vectorcall */ +#if PY_VERSION_HEX >= 0x030c0000 + ,0 /*tp_watched */ +#endif #elif PY_VERSION_HEX >= 0x03080000 ,0 /*tp_vectorcall */ /* bpo-37250: kept for backwards compatibility in CPython 3.8 only */ diff --git a/src/Tools/generateTemplates/templateClassPyExport.py b/src/Tools/generateTemplates/templateClassPyExport.py index 728a3db1ad..885d889bae 100644 --- a/src/Tools/generateTemplates/templateClassPyExport.py +++ b/src/Tools/generateTemplates/templateClassPyExport.py @@ -380,6 +380,9 @@ PyTypeObject @self.export.Name@::Type = { nullptr /*tp_finalize */ #if PY_VERSION_HEX >= 0x03090000 ,nullptr /*tp_vectorcall */ +#if PY_VERSION_HEX >= 0x030c0000 + ,0 /*tp_watched */ +#endif #elif PY_VERSION_HEX >= 0x03080000 ,nullptr /*tp_vectorcall */ /* bpo-37250: kept for backwards compatibility in CPython 3.8 only */