From 4bf744b8698cc82c3a6194e26e7480f31128dec7 Mon Sep 17 00:00:00 2001 From: zhang-liang-pengkun Date: Tue, 26 Dec 2023 19:47:41 +0800 Subject: [PATCH] xcbgen: Use xml.etree.ElementTree for Python >= 3.3. Signed-off-by: zhang-liang-pengkun --- ...xml.etree.ElementTree-for-Python-3.3.patch | 53 +++++++++++++++++++ xcb-proto.spec | 6 ++- 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 0005-xcbgen-Use-xml.etree.ElementTree-for-Python-3.3.patch diff --git a/0005-xcbgen-Use-xml.etree.ElementTree-for-Python-3.3.patch b/0005-xcbgen-Use-xml.etree.ElementTree-for-Python-3.3.patch new file mode 100644 index 0000000..79c6de0 --- /dev/null +++ b/0005-xcbgen-Use-xml.etree.ElementTree-for-Python-3.3.patch @@ -0,0 +1,53 @@ +From 029d5b5d705a27a9bb16fb7fb9b0d2b03dab424a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= +Date: Thu, 4 Jun 2020 20:48:51 +0200 +Subject: [PATCH] xcbgen: Use xml.etree.ElementTree for Python >= 3.3. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +In commit 7d58eed95f796fc764741d7549ee2214bbbcc64c we started +to use xml.etree.ElementTree for Python >= 3.9. In fact the +xml.etree.cElementTree module has already been deprecated +since Python 3.3. + +Given this fact, we should start to use the xml.etree.ElementTree +module beginning with Python 3.3. + +See: https://github.com/python/cpython/commit/a72a98f24a19928e31dcc4cab2cd2ad0f1846e11 + +Signed-off-by: Björn Esser +--- + xcbgen/matcher.py | 2 +- + xcbgen/state.py | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/xcbgen/matcher.py b/xcbgen/matcher.py +index a13ef28..0d57685 100644 +--- a/xcbgen/matcher.py ++++ b/xcbgen/matcher.py +@@ -9,7 +9,7 @@ we do not create a new type object, we just record the existing one under a new + from os.path import join + from sys import version_info + +-if version_info[:2] >= (3, 9): ++if version_info[:2] >= (3, 3): + from xml.etree.ElementTree import parse + else: + from xml.etree.cElementTree import parse +diff --git a/xcbgen/state.py b/xcbgen/state.py +index 3b7eeb4..ffbfc14 100644 +--- a/xcbgen/state.py ++++ b/xcbgen/state.py +@@ -4,7 +4,7 @@ This module contains the namespace class and the singleton module class. + from os.path import dirname, basename + from sys import version_info + +-if version_info[:2] >= (3, 9): ++if version_info[:2] >= (3, 3): + from xml.etree.ElementTree import parse + else: + from xml.etree.cElementTree import parse +-- +2.39.0.windows.2 + diff --git a/xcb-proto.spec b/xcb-proto.spec index 8e41fb8..e0bf1ab 100644 --- a/xcb-proto.spec +++ b/xcb-proto.spec @@ -1,7 +1,7 @@ %define debug_package %{nil} Name: xcb-proto Version: 1.14 -Release: 6 +Release: 7 Summary: XCB protocol descriptions License: MIT URL: https://gitlab.freedesktop.org/xorg/proto/xcbproto/ @@ -10,6 +10,7 @@ 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 Patch04: 0004-xfixes-Add-ClientDisconnectMode.patch +Patch05: 0005-xcbgen-Use-xml.etree.ElementTree-for-Python-3.3.patch BuildArch: noarch BuildRequires: python3-devel @@ -40,6 +41,9 @@ export PYTHON="python3" %{python3_sitelib}/xcbgen %changelog +* Tue Dec 26 2023 zhangliangpengkun - 1.14-7 +- xcbgen: Use xml.etree.ElementTree for Python >= 3.3. + * Fri Dec 01 2023 zhangliangpengkun - 1.14-6 - xfixes: Add ClientDisconnectMode -- Gitee