From f571fb1ac75350de5d3b269be12afd72245e438b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= Date: Wed, 15 Jun 2022 12:10:58 +0200 Subject: [PATCH] Add patch for compatibility with Python 3.11 --- 0001-Py-3.11-fix.patch | 31 +++++++++++++++++++++++++++++++ sip6.spec | 6 +++++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 0001-Py-3.11-fix.patch diff --git a/0001-Py-3.11-fix.patch b/0001-Py-3.11-fix.patch new file mode 100644 index 0000000..fed89b2 --- /dev/null +++ b/0001-Py-3.11-fix.patch @@ -0,0 +1,31 @@ +From d9d7e72154aa4434538410357de8b90bf6e573d1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= +Date: Wed, 23 Mar 2022 09:26:55 +0100 +Subject: [PATCH] Py 3.11 fix + +--- + sipbuild/module/source/12/siplib.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/sipbuild/module/source/12/siplib.c b/sipbuild/module/source/12/siplib.c +index 2d74650..3412364 100644 +--- a/sipbuild/module/source/12/siplib.c ++++ b/sipbuild/module/source/12/siplib.c +@@ -12750,7 +12750,14 @@ static struct _frame *sip_api_get_frame(int depth) + + while (frame != NULL && depth > 0) + { ++#if PY_VERSION_HEX < 0x03090000 + frame = frame->f_back; ++#else ++ frame = PyFrame_GetBack(frame); ++ ++ /* Historically we return a borrowed reference. */ ++ Py_XDECREF(frame); ++#endif + --depth; + } + +-- +2.33.1 + diff --git a/sip6.spec b/sip6.spec index be8139a..a9448a7 100644 --- a/sip6.spec +++ b/sip6.spec @@ -2,7 +2,7 @@ Name: sip6 Version: 6.5.1 -Release: 2%{?dist} +Release: 3%{?dist} Summary: SIP - Python/C++ Bindings Generator %py_provides python3-sip6 # Remove when F34 is EOL @@ -13,6 +13,7 @@ Obsoletes: sip5 < 6.0.0 License: (GPLv2 or GPLv3) and (GPLv2+ with exceptions) URL: https://www.riverbankcomputing.com/software/sip Source0: %{pypi_source} +Patch1: 0001-Py-3.11-fix.patch BuildRequires: gcc BuildRequires: python3-devel @@ -48,6 +49,9 @@ Python bindings for wxWidgets.} %{python3_sitearch}/sipbuild/ %changelog +* Wed Jun 15 2022 Tomáš Hrnčiar - 6.5.1-3 +- Add patch for Python 3.11 compatibility + * Mon Jun 13 2022 Python Maint - 6.5.1-2 - Rebuilt for Python 3.11