void-packages/srcpkgs/boost/patches/python-3.11.patch

49 lines
1.7 KiB
Diff
Raw Normal View History

2023-08-22 09:42:03 +02:00
--- a/boost/parameter/python.hpp
+++ b/boost/parameter/python.hpp
@@ -66,7 +66,11 @@ namespace boost { namespace parameter {
if (Py_TYPE(&unspecified) == 0)
{
+#if PY_VERSION_HEX >= 0x03090000
+ Py_SET_TYPE(&unspecified, &PyType_Type);
+#else
Py_TYPE(&unspecified) = &PyType_Type;
+#endif
PyType_Ready(&unspecified);
}
--- a/libs/python/test/upcast.cpp
+++ b/libs/python/test/upcast.cpp
@@ -13,7 +13,7 @@ int main()
{
PyTypeObject o;
Y y;
- BOOST_TEST(&Py_REFCNT(boost::python::upcast<PyObject>(&o)) == &Py_REFCNT(&o));
- BOOST_TEST(&Py_REFCNT(boost::python::upcast<PyObject>(&y)) == &Py_REFCNT(&y));
+ BOOST_TEST(Py_REFCNT(boost::python::upcast<PyObject>(&o)) == Py_REFCNT(&o));
+ BOOST_TEST(Py_REFCNT(boost::python::upcast<PyObject>(&y)) == Py_REFCNT(&y));
return boost::report_errors();
}
--- a/libs/python/test/pickle1.py
+++ b/libs/python/test/pickle1.py
@@ -10,7 +10,7 @@ r'''>>> import pickle1_ext
>>> pickle1_ext.world.__name__
'world'
>>> pickle1_ext.world('Hello').__reduce__()
- (<class 'pickle1_ext.world'>, ('Hello',))
+ (<class 'pickle1_ext.world'>, ('Hello',), None)
>>> wd = pickle1_ext.world('California')
>>> pstr = pickle.dumps(wd)
>>> wl = pickle.loads(pstr)
--- a/libs/python/test/pickle4.py
+++ b/libs/python/test/pickle4.py
@@ -13,7 +13,7 @@ r'''>>> import pickle4_ext
>>> pickle4_ext.world.__name__
'world'
>>> pickle4_ext.world('Hello').__reduce__()
- (<class 'pickle4_ext.world'>, ('Hello',))
+ (<class 'pickle4_ext.world'>, ('Hello',), None)
>>> wd = pickle4_ext.world('California')
>>> pstr = pickle.dumps(wd)
>>> wl = pickle.loads(pstr)