From 9cd0b26ca89652236a8837ad8be8bf070cd41ba8 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Thu, 26 Mar 2020 22:35:52 +0100 Subject: [PATCH] Fix the build with Python 3.9 Thanks Stephen Gallagher for fixing this upstream! https://bugzilla.redhat.com/show_bug.cgi?id=1817649 --- ...to-deprecated-xml.etree.cElementTree.patch | 45 +++++++++++++++++++ gobject-introspection.spec | 8 +++- 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 0001-Replace-calls-to-deprecated-xml.etree.cElementTree.patch diff --git a/0001-Replace-calls-to-deprecated-xml.etree.cElementTree.patch b/0001-Replace-calls-to-deprecated-xml.etree.cElementTree.patch new file mode 100644 index 0000000..b47233e --- /dev/null +++ b/0001-Replace-calls-to-deprecated-xml.etree.cElementTree.patch @@ -0,0 +1,45 @@ +From 8ceb23621d7e59718c1d512155aae8e8eb17db56 Mon Sep 17 00:00:00 2001 +From: Stephen Gallagher +Date: Thu, 26 Mar 2020 15:17:37 -0400 +Subject: [PATCH] Replace calls to deprecated xml.etree.cElementTree + +cElementTree was removed in Python 3.9 in favor of ElementTree, +which has used a fast, native implementation since Python 3.3. + +Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1817649 + +Signed-off-by: Stephen Gallagher +--- + giscanner/gdumpparser.py | 2 +- + giscanner/girparser.py | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/giscanner/gdumpparser.py b/giscanner/gdumpparser.py +index 1730fee5..e7ccf575 100644 +--- a/giscanner/gdumpparser.py ++++ b/giscanner/gdumpparser.py +@@ -22,7 +22,7 @@ import os + import sys + import tempfile + import subprocess +-from xml.etree.cElementTree import parse ++from xml.etree.ElementTree import parse + + from . import ast + from . import message +diff --git a/giscanner/girparser.py b/giscanner/girparser.py +index 0a6c687b..35206a41 100644 +--- a/giscanner/girparser.py ++++ b/giscanner/girparser.py +@@ -21,7 +21,7 @@ + import os + + from collections import OrderedDict +-from xml.etree.cElementTree import parse ++from xml.etree.ElementTree import parse + + from . import ast + from .girwriter import COMPATIBLE_GIR_VERSION +-- +2.25.2 + diff --git a/gobject-introspection.spec b/gobject-introspection.spec index 26cd605..2e26672 100644 --- a/gobject-introspection.spec +++ b/gobject-introspection.spec @@ -4,13 +4,16 @@ Name: gobject-introspection Version: 1.64.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Introspection system for GObject-based libraries License: GPLv2+, LGPLv2+, MIT URL: https://wiki.gnome.org/Projects/GObjectIntrospection Source0: https://download.gnome.org/sources/gobject-introspection/1.64/%{name}-%{version}.tar.xz +# Fix the build with Python 3.9 +Patch0: 0001-Replace-calls-to-deprecated-xml.etree.cElementTree.patch + BuildRequires: gcc BuildRequires: bison BuildRequires: cairo-gobject-devel @@ -86,6 +89,9 @@ Libraries and headers for gobject-introspection %{_mandir}/man1/g-ir-scanner.1* %changelog +* Thu Mar 26 2020 Kalev Lember - 1.64.0-2 +- Fix the build with Python 3.9 (#1817649) + * Sat Mar 07 2020 Kalev Lember - 1.64.0-1 - Update to 1.64.0