diff --git a/0001-Fix-for-Python-3.12-support.patch b/0001-Fix-for-Python-3.12-support.patch new file mode 100644 index 0000000..b806ca5 --- /dev/null +++ b/0001-Fix-for-Python-3.12-support.patch @@ -0,0 +1,32 @@ +From 81727b51fcbbd9dfa0fc6a1206c1a937c8387de3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20Van=C4=9Bk?= +Date: Mon, 29 May 2023 15:31:00 +0200 +Subject: [PATCH] Fix for Python 3.12 support + +The HAVE_STDARG_PROTOTYPES macro was removed in Python 3.12 [1,2] and +va_start with two arguments is always expected. Therefore, Python +version is newly checked as well and va_start with 2 arguments is +selected for python version greater or equal to 3.12. + +[1] https://github.com/python/cpython/commit/cb04a09d2dfd197436a11de504b92773569e19fb +[2] https://github.com/python/cpython/issues/93207 +--- + immutables/_map.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/immutables/_map.c b/immutables/_map.c +index 61ca2b9..97ef265 100644 +--- a/immutables/_map.c ++++ b/immutables/_map.c +@@ -529,7 +529,7 @@ _map_dump_format(_PyUnicodeWriter *writer, const char *format, ...) + int ret; + + va_list vargs; +-#ifdef HAVE_STDARG_PROTOTYPES ++#if defined(HAVE_STDARG_PROTOTYPES) || PY_VERSION_HEX >= 0x030C0000 + va_start(vargs, format); + #else + va_start(vargs); +-- +2.41.0 + diff --git a/python-immutables.spec b/python-immutables.spec index 1a97195..48eed71 100644 --- a/python-immutables.spec +++ b/python-immutables.spec @@ -16,7 +16,7 @@ get() operations, which is essentially O(1) for relatively small mappings.} Name: python-%{srcname} Version: 0.19 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Immutable Collections # The entire source code is Apache-2.0, except pythoncapi_compat.h, which is # 0BSD. While this file is unbundled, it is a header-only library; its entire @@ -29,6 +29,8 @@ Summary: Immutable Collections License: Apache-2.0 AND 0BSD URL: https://github.com/MagicStack/immutables Source: %pypi_source +Patch: 0001-Fix-for-Python-3.12-support.patch + BuildRequires: gcc @@ -48,7 +50,7 @@ BuildRequires: pythoncapi-compat-static %prep -%autosetup -n %{srcname}-%{version} +%autosetup -n %{srcname}-%{version} -p 1 # don't install source files sed -e '/include_package_data=/ s/True/False/' -i setup.py @@ -86,6 +88,9 @@ rm -vf immutables/pythoncapi_compat.h %changelog +* Fri Jul 21 2023 Carl George - 0.19-5 +- Python 3.12 compatibility, resolves rhbz#2220276 + * Fri Jul 21 2023 Fedora Release Engineering - 0.19-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild