!3 fixes for python 3.9

Merge pull request !3 from dongyuzhen/openEuler-22.03-LTS-Next
This commit is contained in:
openeuler-ci-bot 2022-01-08 11:47:30 +00:00 committed by Gitee
commit b974032f81
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 52 additions and 1 deletions

View File

@ -0,0 +1,42 @@
From 426ae35bee1fa0fdb8b5120b1dcd20cee6e34512 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= <besser82@fedoraproject.org>
Date: Mon, 1 Jun 2020 12:24:16 +0200
Subject: [PATCH] xcbgen: Use math.gcd() for Python >= 3.5.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
fractions.gcd() has been deprecated since Python 3.5, and
was finally dropped in Python 3.9. It is recommended to
use math.gcd() instead.
Signed-off-by: Bj枚rn Esser <besser82@fedoraproject.org>
Conflict:NA
Reference:https://gitlab.freedesktop.org/xorg/proto/xcbproto/-/commit/426ae35bee1fa0fdb8b5120b1dcd20cee6e34512
---
xcbgen/align.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/xcbgen/align.py b/xcbgen/align.py
index d4c12ee..5c4f517 100644
--- a/xcbgen/align.py
+++ b/xcbgen/align.py
@@ -2,7 +2,12 @@
This module contains helper classes for alignment arithmetic and checks
'''
-from fractions import gcd
+from sys import version_info
+
+if version_info[:2] >= (3, 5):
+ from math import gcd
+else:
+ from fractions import gcd
class Alignment(object):
--
GitLab

View File

@ -1,11 +1,14 @@
%define debug_package %{nil} %define debug_package %{nil}
Name: xcb-proto Name: xcb-proto
Version: 1.14 Version: 1.14
Release: 1 Release: 2
Summary: XCB protocol descriptions Summary: XCB protocol descriptions
License: MIT License: MIT
URL: https://xcb.freedesktop.org/ URL: https://xcb.freedesktop.org/
Source0: https://xcb.freedesktop.org/dist/%{name}-%{version}.tar.gz Source0: https://xcb.freedesktop.org/dist/%{name}-%{version}.tar.gz
Patch6000: backport-fixes-for-python-3.9.patch
BuildArch: noarch BuildArch: noarch
BuildRequires: python3-devel BuildRequires: python3-devel
@ -36,6 +39,12 @@ export PYTHON="python3"
%{python3_sitelib}/xcbgen %{python3_sitelib}/xcbgen
%changelog %changelog
* Sat Jan 08 2022 dongyuzhen <dongyuzhen@huawei.com> - 1.14-2
- Type:bugfix
- CVE:NA
- SUG:NA
- DESC:fixes for python 3.9
* Mon Jul 27 2020 chxssg<chxssg@qq.com> - 1.14-1 * Mon Jul 27 2020 chxssg<chxssg@qq.com> - 1.14-1
- update package to 1.14 - update package to 1.14