void-packages/srcpkgs/rdiff-backup/patches/python-3.11.patch

17 lines
579 B
Diff

--- a/src/_librsyncmodule.c
+++ b/src/_librsyncmodule.c
@@ -540,8 +540,13 @@ PyMODINIT_FUNC PyInit__librsync(void)
{
PyObject *m, *d;
+#if PY_VERSION_HEX >= 0x03090000
+ Py_SET_TYPE(&_librsync_SigMakerType, &PyType_Type);
+ Py_SET_TYPE(&_librsync_DeltaMakerType, &PyType_Type);
+#else
Py_TYPE(&_librsync_SigMakerType) = &PyType_Type;
Py_TYPE(&_librsync_DeltaMakerType) = &PyType_Type;
+#endif
static struct PyModuleDef librsync_def = {
PyModuleDef_HEAD_INIT, "_librsync", "RSync Lib", -1, _librsyncMethods, };
m = PyModule_Create(&librsync_def);