diff --git a/src/3rdParty/PyCXX/CXX/Python3/Config.hxx b/src/3rdParty/PyCXX/CXX/Python3/Config.hxx index 08aa495269..76bd4b786b 100644 --- a/src/3rdParty/PyCXX/CXX/Python3/Config.hxx +++ b/src/3rdParty/PyCXX/CXX/Python3/Config.hxx @@ -133,6 +133,10 @@ typedef long int Py_hash_t; #endif +#if PY_VERSION_HEX >= 0x030d0000 +#define Py_UNICODE_DEPRECATED +#endif + #ifndef PYCXX_PYTHON_2TO3 #define PYCXX_PYTHON_2TO3 #endif diff --git a/src/3rdParty/PyCXX/CXX/Python3/Objects.hxx b/src/3rdParty/PyCXX/CXX/Python3/Objects.hxx index 0ed3fc969b..e216d6858d 100644 --- a/src/3rdParty/PyCXX/CXX/Python3/Objects.hxx +++ b/src/3rdParty/PyCXX/CXX/Python3/Objects.hxx @@ -1783,7 +1783,7 @@ namespace Py // Python strings return strings as individual elements. // I'll try having a class Char which is a String of length 1 // -#if !defined(Py_LIMITED_API) +#if !defined(Py_LIMITED_API) && !defined(Py_UNICODE_DEPRECATED) typedef std::basic_string unicodestring; extern Py_UNICODE unicode_null_string[1]; #endif @@ -1979,7 +1979,7 @@ namespace Py validate(); } -#if !defined( Py_LIMITED_API ) +#if !defined( Py_LIMITED_API ) && !defined(Py_UNICODE_DEPRECATED) Char( Py_UNICODE v ) : Object( PyUnicode_FromOrdinal( v ), true ) { @@ -1987,7 +1987,7 @@ namespace Py } #endif -#if !defined( Py_LIMITED_API ) +#if !defined( Py_LIMITED_API ) && !defined(Py_UNICODE_DEPRECATED) Char( const unicodestring &v ) : Object( PyUnicode_FromKindAndData( PyUnicode_4BYTE_KIND, const_cast( v.data() ),1 ), true ) { @@ -2008,7 +2008,7 @@ namespace Py return *this; } -#if !defined( Py_LIMITED_API ) +#if !defined( Py_LIMITED_API ) && !defined(Py_UNICODE_DEPRECATED) Char &operator=( const unicodestring &v ) { set( PyUnicode_FromKindAndData( PyUnicode_4BYTE_KIND, const_cast( v.data() ), 1 ), true ); @@ -2016,7 +2016,7 @@ namespace Py } #endif -#if !defined( Py_LIMITED_API ) +#if !defined( Py_LIMITED_API ) && !defined(Py_UNICODE_DEPRECATED) Char &operator=( int v_ ) { Py_UNICODE v( v_ ); @@ -2025,7 +2025,7 @@ namespace Py } #endif -#if !defined( Py_LIMITED_API ) +#if !defined( Py_LIMITED_API ) && !defined(Py_UNICODE_DEPRECATED) Char &operator=( Py_UNICODE v ) { set( PyUnicode_FromKindAndData( PyUnicode_4BYTE_KIND, &v, 1 ), true ); @@ -2164,7 +2164,7 @@ namespace Py } #endif -#if !defined( Py_LIMITED_API ) +#if !defined( Py_LIMITED_API ) && !defined(Py_UNICODE_DEPRECATED) String( const Py_UNICODE *s, int length ) : SeqBase( PyUnicode_FromKindAndData( PyUnicode_4BYTE_KIND, s, length ), true ) { @@ -2185,7 +2185,7 @@ namespace Py return *this; } -#if !defined( Py_LIMITED_API ) +#if !defined( Py_LIMITED_API ) && !defined(Py_UNICODE_DEPRECATED) String &operator=( const unicodestring &v ) { set( PyUnicode_FromKindAndData( PyUnicode_4BYTE_KIND, const_cast( v.data() ), v.length() ), true ); diff --git a/src/3rdParty/PyCXX/CXX/Python3/cxxsupport.cxx b/src/3rdParty/PyCXX/CXX/Python3/cxxsupport.cxx index 3c58afe960..dad7198648 100644 --- a/src/3rdParty/PyCXX/CXX/Python3/cxxsupport.cxx +++ b/src/3rdParty/PyCXX/CXX/Python3/cxxsupport.cxx @@ -45,7 +45,7 @@ Py_ssize_t numeric_limits_max() return std::numeric_limits::max(); } -#if !defined(Py_LIMITED_API) +#if !defined(Py_LIMITED_API) && !defined(Py_UNICODE_DEPRECATED) Py_UNICODE unicode_null_string[1] = { 0 }; #endif char32_t ucs4_null_string[1] = { 0 }; diff --git a/src/App/FeaturePythonPyImp.h b/src/App/FeaturePythonPyImp.h index 3b0d56e328..549217cc3b 100644 --- a/src/App/FeaturePythonPyImp.h +++ b/src/App/FeaturePythonPyImp.h @@ -46,7 +46,9 @@ virtual ~_class_(); \ }; -#if PY_VERSION_HEX >= 0x030c0000 +#if PY_VERSION_HEX >= 0x030d0000 +#define PYTHON_TYPE_SLOTS 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +#elif 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 #else #define PYTHON_TYPE_SLOTS 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 95f53ef790..fd7418e347 100644 --- a/src/App/FeaturePythonPyImp.inl +++ b/src/App/FeaturePythonPyImp.inl @@ -83,6 +83,9 @@ PyTypeObject FeaturePythonPyT::Type = { #if PY_VERSION_HEX >= 0x030c0000 ,0 /*tp_watched */ #endif +#if PY_VERSION_HEX >= 0x030d0000 + ,0 /*tp_versions_used */ +#endif }; template