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 1PmkOx-00057i-5k for garchives@archives.gentoo.org; Tue, 08 Feb 2011 10:02:28 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id EB9C7E0799; Tue, 8 Feb 2011 10:02:19 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id B98A3E0799 for ; Tue, 8 Feb 2011 10:02:19 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 2AF611B420F for ; Tue, 8 Feb 2011 10:02:19 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 8A9088006A for ; Tue, 8 Feb 2011 10:02:18 +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: <8e6c622174ca5fb8ae1789687954e4335f7a0a2e.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/repoman/, pym/portage/tests/lint/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/tests/lint/test_import_modules.py pym/repoman/herdbase.py X-VCS-Directories: pym/repoman/ pym/portage/tests/lint/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 8e6c622174ca5fb8ae1789687954e4335f7a0a2e Date: Tue, 8 Feb 2011 10:02:18 +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: 790a083907f2998014ca1886a1e057e4 commit: 8e6c622174ca5fb8ae1789687954e4335f7a0a2e Author: Zac Medico gentoo org> AuthorDate: Tue Feb 8 10:01:13 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Tue Feb 8 10:01:13 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3D8e6c6221 repoman.herdbase: tolerate expat ImportError We tolerate global scope import failures for optional modules, so that ImportModulesTestCase can succeed (or possibly alert us about unexpected import failures). --- pym/portage/tests/lint/test_import_modules.py | 1 - pym/repoman/herdbase.py | 11 +++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/pym/portage/tests/lint/test_import_modules.py b/pym/portage/= tests/lint/test_import_modules.py index 81ffede..8d257c5 100644 --- a/pym/portage/tests/lint/test_import_modules.py +++ b/pym/portage/tests/lint/test_import_modules.py @@ -11,7 +11,6 @@ class ImportModulesTestCase(TestCase): =20 def testImportModules(self): expected_failures =3D frozenset(( - 'repoman.herdbase', # requires python with xml support )) =20 for mod in self._iter_modules(PORTAGE_PYM_PATH): diff --git a/pym/repoman/herdbase.py b/pym/repoman/herdbase.py index 4808d3c..64b59e6 100644 --- a/pym/repoman/herdbase.py +++ b/pym/repoman/herdbase.py @@ -1,11 +1,18 @@ # -*- coding: utf-8 -*- # repoman: Herd database analysis -# Copyright 2010 Gentoo Foundation +# Copyright 2010-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 or la= ter =20 import errno import xml.etree.ElementTree -from xml.parsers.expat import ExpatError +try: + from xml.parsers.expat import ExpatError +except ImportError: + # This means that python is built without xml support. + # We tolerate global scope import failures for optional + # modules, so that ImportModulesTestCase can succeed (or + # possibly alert us about unexpected import failures). + pass from portage.exception import FileNotFound, ParseError, PermissionDenied =20 __all__ =3D [