Fix build failure caused by python update to 3.11

This commit is contained in:
starlet-dx 2023-08-04 11:33:04 +08:00
parent b1958f0a31
commit b028ea342d
2 changed files with 32 additions and 3 deletions

View File

@ -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

View File

@ -1,11 +1,12 @@
%global _empty_manifest_terminate_build 0 %global _empty_manifest_terminate_build 0
Name: python-dataclasses Name: python-dataclasses
Version: 0.8 Version: 0.8
Release: 1 Release: 2
Summary: A backport of the dataclasses module for Python 3.6 Summary: A backport of the dataclasses module for Python 3.6
License: Apache-2.0 License: Apache-2.0
URL: https://github.com/ericvsmith/dataclasses URL: https://github.com/ericvsmith/dataclasses
Source0: https://files.pythonhosted.org/packages/1f/12/7919c5d8b9c497f9180db15ea8ead6499812ea8264a6ae18766d93c59fe5/dataclasses-0.8.tar.gz Source0: https://files.pythonhosted.org/packages/1f/12/7919c5d8b9c497f9180db15ea8ead6499812ea8264a6ae18766d93c59fe5/dataclasses-0.8.tar.gz
Patch0: Fix-build-failure-py311.patch
BuildArch: noarch BuildArch: noarch
@ -27,7 +28,7 @@ Provides: python3-dataclasses-doc
pip install dataclasses pip install dataclasses
%prep %prep
%autosetup -n dataclasses-0.8 %autosetup -n dataclasses-%{version} -p1
%build %build
%py3_build %py3_build
@ -67,5 +68,8 @@ mv %{buildroot}/doclist.lst .
%{_docdir}/* %{_docdir}/*
%changelog %changelog
* Mon Nov 23 2020 Python_Bot <Python_Bot@openeuler.org> * Fri Aug 04 2023 yaoxin <yao_xin001@hoperun.com> - 0.8-2
- Fix build failure caused by python update to 3.11
* Mon Nov 23 2020 Python_Bot <Python_Bot@openeuler.org> - 0.8-1
- Package Spec generated - Package Spec generated