diff options
Diffstat (limited to 'giscanner')
-rw-r--r-- | giscanner/girparser.py | 12 |
1 files 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('function-macro')] = self._parse_function_macro 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) |