xcbgen: xml.etree.cElementTree has been dropped in Python 3.9.
Signed-off-by: zhang-liang-pengkun <zhangliangpengkun@xfusion.com>
This commit is contained in:
parent
98d9a12e0c
commit
06278b65d3
@ -0,0 +1,56 @@
|
||||
From 7d58eed95f796fc764741d7549ee2214bbbcc64c Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= <besser82@fedoraproject.org>
|
||||
Date: Mon, 1 Jun 2020 12:29:01 +0200
|
||||
Subject: [PATCH] xcbgen: xml.etree.cElementTree has been dropped in Python
|
||||
3.9.
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
It can be replaced with xml.etree.ElementTree safely.
|
||||
|
||||
Signed-off-by: Björn Esser <besser82@fedoraproject.org>
|
||||
---
|
||||
xcbgen/matcher.py | 7 ++++++-
|
||||
xcbgen/state.py | 7 ++++++-
|
||||
2 files changed, 12 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/xcbgen/matcher.py b/xcbgen/matcher.py
|
||||
index 97a8b43..a13ef28 100644
|
||||
--- a/xcbgen/matcher.py
|
||||
+++ b/xcbgen/matcher.py
|
||||
@@ -7,7 +7,12 @@ we do not create a new type object, we just record the existing one under a new
|
||||
'''
|
||||
|
||||
from os.path import join
|
||||
-from xml.etree.cElementTree import parse
|
||||
+from sys import version_info
|
||||
+
|
||||
+if version_info[:2] >= (3, 9):
|
||||
+ from xml.etree.ElementTree import parse
|
||||
+else:
|
||||
+ from xml.etree.cElementTree import parse
|
||||
|
||||
from xcbgen.xtypes import *
|
||||
|
||||
diff --git a/xcbgen/state.py b/xcbgen/state.py
|
||||
index 0dbecdc..3b7eeb4 100644
|
||||
--- a/xcbgen/state.py
|
||||
+++ b/xcbgen/state.py
|
||||
@@ -2,7 +2,12 @@
|
||||
This module contains the namespace class and the singleton module class.
|
||||
'''
|
||||
from os.path import dirname, basename
|
||||
-from xml.etree.cElementTree import parse
|
||||
+from sys import version_info
|
||||
+
|
||||
+if version_info[:2] >= (3, 9):
|
||||
+ from xml.etree.ElementTree import parse
|
||||
+else:
|
||||
+ from xml.etree.cElementTree import parse
|
||||
|
||||
from xcbgen import matcher
|
||||
from xcbgen.error import *
|
||||
--
|
||||
2.39.0.windows.2
|
||||
|
||||
@ -1,13 +1,14 @@
|
||||
%define debug_package %{nil}
|
||||
Name: xcb-proto
|
||||
Version: 1.14
|
||||
Release: 4
|
||||
Release: 5
|
||||
Summary: XCB protocol descriptions
|
||||
License: MIT
|
||||
URL: https://gitlab.freedesktop.org/xorg/proto/xcbproto/
|
||||
Source0: https://xcb.freedesktop.org/dist/%{name}-%{version}.tar.gz
|
||||
Patch01: 0001-Parse-a-field-s-enum-correctly.patch
|
||||
Patch02: 0002-xcbgen-Use-math.gcd-for-Python-3.5.patch
|
||||
Patch03: 0003-xcbgen-xml.etree.cElementTree-has-been-dropped-in-Py.patch
|
||||
BuildArch: noarch
|
||||
|
||||
BuildRequires: python3-devel
|
||||
@ -38,6 +39,9 @@ export PYTHON="python3"
|
||||
%{python3_sitelib}/xcbgen
|
||||
|
||||
%changelog
|
||||
* Wed Nov 01 2023 zhangliangpengkun<zhangliangpengkun@xfusion.com> - 1.14-5
|
||||
- xcbgen: xml.etree.cElementTree has been dropped in Python 3.9.
|
||||
|
||||
* Fri Oct 20 2023 zhangliangpengkun<zhangliangpengkun@xfusion.com> - 1.14-4
|
||||
- xcbgen: Use math.gcd() for Python >= 3.5.
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user