From 116f95fe660fd76ec40d6b0335ac3d9813065492 Mon Sep 17 00:00:00 2001 From: starlet-dx <15929766099@163.com> Date: Fri, 4 Aug 2023 11:33:04 +0800 Subject: [PATCH] Fix build failure caused by python update to 3.11 (cherry picked from commit b028ea342da3d8e701f10499fd03da38a9763eaa) --- Fix-build-failure-py311.patch | 25 +++++++++++++++++++++++++ python-dataclasses.spec | 10 +++++++--- 2 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 Fix-build-failure-py311.patch diff --git a/Fix-build-failure-py311.patch b/Fix-build-failure-py311.patch new file mode 100644 index 0000000..fd9628b --- /dev/null +++ b/Fix-build-failure-py311.patch @@ -0,0 +1,25 @@ +From 093f12f4414f3f2f98154f9e024ffb8e5cf9b21a Mon Sep 17 00:00:00 2001 +From: starlet-dx <15929766099@163.com> +Date: Fri, 4 Aug 2023 10:47:30 +0800 +Subject: [PATCH 1/1] Fix build failure + +--- + dataclasses.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dataclasses.py b/dataclasses.py +index ddd59c6..c8150ae 100644 +--- a/dataclasses.py ++++ b/dataclasses.py +@@ -547,7 +547,7 @@ def _hash_fn(fields): + def _is_classvar(a_type, typing): + # This test uses a typing internal class, but it's the best way to + # test if this is a ClassVar. +- return type(a_type) is typing._ClassVar ++ return type(a_type) is typing.ClassVar + + + def _is_initvar(a_type, dataclasses): +-- +2.30.0 + diff --git a/python-dataclasses.spec b/python-dataclasses.spec index 1c677bc..d3c29ef 100644 --- a/python-dataclasses.spec +++ b/python-dataclasses.spec @@ -1,11 +1,12 @@ %global _empty_manifest_terminate_build 0 Name: python-dataclasses Version: 0.8 -Release: 1 +Release: 2 Summary: A backport of the dataclasses module for Python 3.6 License: Apache-2.0 URL: https://github.com/ericvsmith/dataclasses Source0: https://files.pythonhosted.org/packages/1f/12/7919c5d8b9c497f9180db15ea8ead6499812ea8264a6ae18766d93c59fe5/dataclasses-0.8.tar.gz +Patch0: Fix-build-failure-py311.patch BuildArch: noarch @@ -27,7 +28,7 @@ Provides: python3-dataclasses-doc pip install dataclasses %prep -%autosetup -n dataclasses-0.8 +%autosetup -n dataclasses-%{version} -p1 %build %py3_build @@ -67,5 +68,8 @@ mv %{buildroot}/doclist.lst . %{_docdir}/* %changelog -* Mon Nov 23 2020 Python_Bot +* Fri Aug 04 2023 yaoxin - 0.8-2 +- Fix build failure caused by python update to 3.11 + +* Mon Nov 23 2020 Python_Bot - 0.8-1 - Package Spec generated -- Gitee