diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2021-07-14 16:10:34 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2022-01-25 14:39:38 +0530 |
commit | 82714e19d94ddf67a13c18c7719971c8226aca03 (patch) | |
tree | e3fd0b85e30726e2e25398a3148c54c29b51e2f1 | |
parent | d8afc8b5ee5d08144fb314a247a238f07abab2a4 (diff) |
gobject-introspection: Backport patch for Python 3.9 compat
Needed on Fedora 34.
Part-of: <https://gitlab.freedesktop.org/gstreamer/cerbero/-/merge_requests/784>
-rw-r--r-- | recipes/gobject-introspection.recipe | 3 | ||||
-rw-r--r-- | recipes/gobject-introspection/0001-Drop-deprecated-xml.etree.ElementTree.Element.getchi.patch | 71 |
2 files changed, 74 insertions, 0 deletions
diff --git a/recipes/gobject-introspection.recipe b/recipes/gobject-introspection.recipe index c3e6cc2b..84426255 100644 --- a/recipes/gobject-introspection.recipe +++ b/recipes/gobject-introspection.recipe @@ -21,6 +21,9 @@ class Recipe(recipe.Recipe): # Taken from upstream, remove on bump # https://gitlab.gnome.org/GNOME/gobject-introspection/merge_requests/38 name + '/0003-giscanner-Fix-shared-library-name-with-Meson-on-macO.patch', + # Taken from upstream, remove on bump + # https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/194 + name + '/0001-Drop-deprecated-xml.etree.ElementTree.Element.getchi.patch', ] files_bins = ['g-ir-annotation-tool', 'g-ir-compiler', 'g-ir-doc-tool', 'g-ir-generate', 'g-ir-scanner'] diff --git a/recipes/gobject-introspection/0001-Drop-deprecated-xml.etree.ElementTree.Element.getchi.patch b/recipes/gobject-introspection/0001-Drop-deprecated-xml.etree.ElementTree.Element.getchi.patch new file mode 100644 index 00000000..dc14fb80 --- /dev/null +++ b/recipes/gobject-introspection/0001-Drop-deprecated-xml.etree.ElementTree.Element.getchi.patch @@ -0,0 +1,71 @@ +From 1f9284228092b2a7200e8a78bc0ea6702231c6db Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz> +Date: Mon, 6 Jan 2020 14:05:03 +0100 +Subject: [PATCH] Drop deprecated xml.etree.ElementTree.Element.getchildren() + calls + +The XML elements are implicitly iterable in all Python versions including +at least 2.7 and 3.2+. + +The .getchildren() method is deprecated since 2.7 and 3.2, removed in 3.9. + +Fixes https://gitlab.gnome.org/GNOME/gobject-introspection/issues/325 +--- + giscanner/girparser.py | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/giscanner/girparser.py b/giscanner/girparser.py +index 7687c35c..0a6c687b 100644 +--- a/giscanner/girparser.py ++++ b/giscanner/girparser.py +@@ -75,17 +75,17 @@ class GIRParser(object): + + def _find_first_child(self, node, name_or_names): + if isinstance(name_or_names, str): +- for child in node.getchildren(): ++ for child in node: + if child.tag == name_or_names: + return child + else: +- for child in node.getchildren(): ++ for child in node: + if child.tag in name_or_names: + return child + return None + + def _find_children(self, node, name): +- return [child for child in node.getchildren() if child.tag == name] ++ return [child for child in node if child.tag == name] + + def _get_current_file(self): + if not self._filename_stack: +@@ -103,7 +103,7 @@ class GIRParser(object): + raise SystemExit("%s: Incompatible version %s (supported: %s)" % + (self._get_current_file(), version, COMPATIBLE_GIR_VERSION)) + +- for node in root.getchildren(): ++ for node in root: + if node.tag == _corens('include'): + self._parse_include(node) + elif node.tag == _corens('package'): +@@ -145,7 +145,7 @@ class GIRParser(object): + parser_methods[_corens('constant')] = self._parse_constant + parser_methods[_corens('function')] = self._parse_function + +- for node in ns.getchildren(): ++ for node in ns: + method = parser_methods.get(node.tag) + if method is not None: + method(node) +@@ -413,7 +413,7 @@ class GIRParser(object): + def _parse_fields(self, node, obj): + res = [] + names = (_corens('field'), _corens('record'), _corens('union'), _corens('callback')) +- for child in node.getchildren(): ++ for child in node: + if child.tag in names: + fieldobj = self._parse_field(child, obj) + res.append(fieldobj) +-- +2.31.1 + |