From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QwOMK-0002rQ-NN for garchives@archives.gentoo.org; Thu, 25 Aug 2011 01:03:52 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A22FD21C0FF; Thu, 25 Aug 2011 01:03:45 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 706B921C11B for ; Thu, 25 Aug 2011 01:03:45 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id DABED1B4024 for ; Thu, 25 Aug 2011 01:03:44 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 3BA4580040 for ; Thu, 25 Aug 2011 01:03:44 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/xml/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/xml/metadata.py X-VCS-Directories: pym/portage/xml/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: f4d5667a09cb308f30bb7eb5ee14b9ef061c3604 Date: Thu, 25 Aug 2011 01:03:44 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 6a6b8c013c5f5e8d18c4b1c90fd0297f commit: f4d5667a09cb308f30bb7eb5ee14b9ef061c3604 Author: Zac Medico gentoo org> AuthorDate: Thu Aug 25 01:02:40 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Thu Aug 25 01:02:40 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3Df4d5667a ElementTree: use iter if available (bug #380565) --- pym/portage/xml/metadata.py | 13 +++++++++++-- 1 files changed, 11 insertions(+), 2 deletions(-) diff --git a/pym/portage/xml/metadata.py b/pym/portage/xml/metadata.py index 7acc1f3..090d2c0 100644 --- a/pym/portage/xml/metadata.py +++ b/pym/portage/xml/metadata.py @@ -217,7 +217,12 @@ class MetaDataXML(object): if herd in ('no-herd', 'maintainer-wanted', 'maintainer-needed'): return None =20 - for node in self._herdstree.getiterator('herd'): + try: + iterate =3D self._herdstree.iter + except AttributeError: + iterate =3D self._herdstree.getiterator + + for node in iterate('herd'): if node.findtext('name') =3D=3D herd: return node.findtext('email') =20 @@ -292,8 +297,12 @@ class MetaDataXML(object): if self._xml_tree is None: self._useflags =3D tuple() else: + try: + iterate =3D self._xml_tree.iter + except AttributeError: + iterate =3D self._xml_tree.getiterator self._useflags =3D tuple(_Useflag(node) \ - for node in self._xml_tree.getiterator('flag')) + for node in iterate('flag')) =20 return self._useflags =20