From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id CDAE0138359 for ; Fri, 9 Oct 2020 06:29:43 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id F317FE082F; Fri, 9 Oct 2020 06:29:42 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id D6EABE082F for ; Fri, 9 Oct 2020 06:29:42 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id CD024335D99 for ; Fri, 9 Oct 2020 06:29:41 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 7A8932EE for ; Fri, 9 Oct 2020 06:29:40 +0000 (UTC) From: "Georgy Yakovlev" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Georgy Yakovlev" Message-ID: <1602224949.517581df206766fabf10273cde565e0a6dc62829.gyakovlev@gentoo> Subject: [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/ X-VCS-Repository: proj/gentoolkit X-VCS-Files: pym/gentoolkit/metadata.py X-VCS-Directories: pym/gentoolkit/ X-VCS-Committer: gyakovlev X-VCS-Committer-Name: Georgy Yakovlev X-VCS-Revision: 517581df206766fabf10273cde565e0a6dc62829 X-VCS-Branch: master Date: Fri, 9 Oct 2020 06:29:40 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: b46dec34-b54d-4d03-a4e6-2fcb1292fbd5 X-Archives-Hash: c1f27f1ccda21394025f16f4ab9c4cb8 commit: 517581df206766fabf10273cde565e0a6dc62829 Author: Mikk Margus Möll ttu ee> AuthorDate: Wed Oct 7 20:00:51 2020 +0000 Commit: Georgy Yakovlev gentoo org> CommitDate: Fri Oct 9 06:29:09 2020 +0000 URL: https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=517581df metadata: Drop deprecated ElementTree methods Closes: https://github.com/gentoo/gentoolkit/pull/11 Signed-off-by: Georgy Yakovlev gentoo.org> pym/gentoolkit/metadata.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pym/gentoolkit/metadata.py b/pym/gentoolkit/metadata.py index 22c249e..c3dba98 100644 --- a/pym/gentoolkit/metadata.py +++ b/pym/gentoolkit/metadata.py @@ -73,8 +73,7 @@ class _Maintainer(object): self.description = None self.restrict = node.get('restrict') self.status = node.get('status') - maint_attrs = node.getchildren() - for attr in maint_attrs: + for attr in node.iter(): setattr(self, attr.tag, attr.text) def __repr__(self): @@ -101,7 +100,7 @@ class _Useflag(object): _desc = '' if node.text: _desc = node.text - for child in node.getchildren(): + for child in node.iter(): _desc += child.text if child.text else '' _desc += child.tail if child.tail else '' # This takes care of tabs and newlines left from the file @@ -213,7 +212,7 @@ class MetaData(object): if herd in ('no-herd', 'maintainer-wanted', 'maintainer-needed'): return None - for node in self._herdstree.getiterator('herd'): + for node in self._herdstree.iter('herd'): if node.findtext('name') == herd: return node.findtext('email') @@ -283,7 +282,7 @@ class MetaData(object): return self._useflags self._useflags = [] - for node in self._xml_tree.getiterator('flag'): + for node in self._xml_tree.iter('flag'): self._useflags.append(_Useflag(node)) return self._useflags